About last x candle
-
Hello. I created an EA and I want to ask that; for example candle ID:1 > MA 50 = BUY or candle ID:2 > MA 50 = BUY or candle ID:1 > MA 50 = BUY etc...
My question is ; for example i want to get last 50 candles like this. Do I write the candle IDs one by one? Isn't there a short way to get the last 50 candles? -
@gauss You may need custom code to do this, I do have a loop that will count the amount of candles above and below a MA, download and run on tester so you can see how it works, the two blank conditions are to put somewhere like the buy/sell trees
Hope this helps:
-
Actually, I meant: I'm going to define a variable and whatever value I enter into that variable it will get the back candle. for example if I type 20 it will take all the last 20 candles. If any of these 20 candles fit the conditions, the trade will be triggered...