//PIYASADA EMIR YOK ISE İKİ ADET EMİR AÇ
//20 PIPS ASAGISINDA SATIM EMRİ AÇ
//20 PIPS YUKARISINDA ALIM EMRI AÇ
//1000 PIPS TP
//500 PIPS STOPLOSS
the program gives error 148 because of too many orders.
i am triying to limit the orders by the number of 2.
but it continiously opens orders.
how can i resolve it ?
There are no orders in your loop. The orders are located after the loop.
I'm confused by this.
Isn't it the case that if orders total is smaller than 2, the break will be ignored, but as the only action in the loop is the break, what difference does it make.
Unless i am missing something, this does nothing?
Where is the OrderSelect that gets OrderTicket ?
As far as I can see, your order sends are not subject to any conditions, so will open new orders every tick
how can i do it?
put these things into loop i mean .
Why don't you simply do this . . .
if(OrdersTotal() < 2)
. . . or if you really need a loop
while(OrdersTotal() < 2)
. . . you may find that the number of orders is not updated quickly enough, you may need to add a short Sleep() at the end of the loop.