Hi there,

Thanks in advance for your help.

Im trying to make an algorithm that buys as the fastEMA crosses above the slowEMA, and then sells 60 seconds later. I can do this successfully, but then it buys again the next bar (because fastEMA is still greater than slowEMA). It keeps doing this over and over.

How do I make sure that it only buys once on the crossover, takes profits/cuts losses, and doesn't buy again until the next crossover?

 

Thanks for all your help and have a great new year!!!