Check the closed time of the last trade, if it's less than 10 * Period don't place a new trade.
i tried to do that already but then i cant get the closetime, something wrong is with the orderselect, will you show me how?
i tried with orderselect history mode then, close time =0 at all time , how to select the most recent closed order?
Show your code.
in weekend or marketholiday we have a timegap makes this is not working correctly
Check if Time[10] > time last closed trade of the EA and you are allowed to place a new trade
for(PositionIndex = TotalNumberOfOrders - 1; PositionIndex >= 0 ; PositionIndex --) { if(!(OrderSelect(PositionIndex,SELECT_BY_POS,MODE_HISTORY))) { Print ("orderclosetime1",orderclosetime()); if(OrderCloseTime() < bar_intervals*Period()) { Print("orderclosetime",OrderCloseTime()); buysignal=0; sellsignal=0; } } }both the orderclose are 0 in values, is there something wrong in the trade selection?
in weekend or marketholiday we have a timegap makes this is not working correctly
Check if Time[10] > time last closed trade of the EA and you are allowed to place a new trade
both the orderclose are 0 in values, is there something wrong in the trade selection?
I don't mind you using code I have posted on the Forum, but the least you can do is understand what you are copy and pasting . . . .
Edit: Sorry . . I meant if the OrderSelect() fails . . .
for(PositionIndex = TotalNumberOfOrders - 1; PositionIndex >= 0 ; PositionIndex --) { if(!(OrderSelect(PositionIndex,SELECT_BY_POS,MODE_HISTORY))) { Print ("orderclosetime1",orderclosetime()); if(OrderCloseTime() < bar_intervals*Period()) { Print("orderclosetime",OrderCloseTime()); buysignal=0; sellsignal=0; } }
orderclosetime is what i want in value, the orderclosetime1 is just to show myself that the value is available or not with orderselect
so it make sense but just in the other way round, ok? the orderclosetime1 have to be delete after finish coding,now back to the topic
from the code, it seems like the orderselect didnt success in selecting any order, so orderclosetime is always 0. what's wrong with the orderselect?
how do i choose the last close order by magic or by position index?
orderclosetime is what i want in value, the orderclosetime1 is just to show myself that the value is available or not with orderselect
so it make sense but just in the other way round, ok? the orderclosetime1 have to be delete after finish coding,now back to the topic
from the code, it seems like the orderselect didnt success in selecting any order, so orderclosetime is always 0. what's wrong with the orderselect?
how do i choose the last close order by magic or by position index?
Sorry . . I meant if the OrderSelect() fails . . .
OK, answer a simple question please . . . . what does the ! do before the OrderSelect() ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi all, i need a help in coding
i want to disallowed trading for a few bar, lets say 10 bar after a trade is closed, how do i do that?