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...
@gauss you could use a VPS (virtual private server). It allows you to store and run your EAs on a distant server which can get you a better ping and let you turn off your computer. I use Admiral market as a broker and with a 2000€ deposit I can have it for free. If your broker doesn't offer this you can always rent one on MQL5
Actually I already use VPS but i think this latency issue is not related to vps server. because internet speed is very high on mine VPS server.
@gauss But that is a suicidal stategy! Sooner than later your broker will not allow you to open more trades. I don't think this is a good way to trade the market IMHO.