Hi,
Since there's an EA already running on my chart(s), I would like to have my script open three (or more or less, doesn't matter but 1+n, n>=0 trades when it is executed) trades, the first when it is executed on the chart and the rest one per new bar.
currently, this is how the logic looks like, however this only opens the first trade, stay on the chart but doesn't open the next few trades.
It's probably something stupid, but I'm tired and have looked at code most of my waking hours till now and I'm missing it.
Or, I can miss out on the logic entirely.
Either way, any help would be greatly appreciated.
Since there's an EA already running on my chart(s), I would like to have my script open three (or more or less, doesn't matter but 1+n, n>=0 trades when it is executed) trades, the first when it is executed on the chart and the rest one per new bar.
currently, this is how the logic looks like, however this only opens the first trade, stay on the chart but doesn't open the next few trades.
It's probably something stupid, but I'm tired and have looked at code most of my waking hours till now and I'm missing it.
Or, I can miss out on the logic entirely.
Either way, any help would be greatly appreciated.
Inserted Code
int ExtraTrades = 3; datetime stopper=Time[0]; int counter = 1; //+------------------------------------------------------------------+ //| Is new bar | //+------------------------------------------------------------------+ bool IsNewBar() { if (stopper == Time[1]) { stopper = Time[0]; return true; } else { return false; } } //+------------------------------------------------------------------+ void start() { while (counter <= ExtraTrades) { if (counter == 1) { OpenIt(); counter++; } if (IsNewBar()) { OpenIt(); counter++; } } counter = 1; }