Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
@Sergey Golubev ok thanks
Hello,
while coding my brand new EA recently I came accross a quest.
Basically i need to avoid orders which met a certain condition to be modified by my tick-bound modify function.
So i thought about making it the way the expert advisor creates a sort of "Blacklist" with the Ticket numbers of orders which met the condition.
Such condition is when the stop loss is placed at BE.
int BlackListOrderTicket(){ int Ticket; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break; if(OrderMagicNumber()!=HMAGICMA || OrderSymbol()!=Symbol()) continue; if(OrderStopLoss() == OrderOpenPrice()) continue; Ticket = OrderTicket(); SendNotification(StringConcatenate("L'ordine #",OrderTicket()," è stato aggiunto alla Modifying-Blacklist. Le modifiche a questo ordine di hedging non verranno più apportate.")); return(Ticket); } }
what do you guys think? Can this work?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
while coding my brand new EA recently I came accross a quest.
Basically i need to avoid orders which met a certain condition to be modified by my tick-bound modify function.
So i thought about making it the way the expert advisor creates a sort of "Blacklist" with the Ticket numbers of orders which met the condition.
Such condition is when the stop loss is placed at BE.
int BlackListOrderTicket(){
int Ticket;
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderMagicNumber()!=HMAGICMA || OrderSymbol()!=Symbol()) continue;
if(OrderStopLoss() == OrderOpenPrice()) continue;
Ticket = OrderTicket();
SendNotification(StringConcatenate("L'ordine #",OrderTicket()," è stato aggiunto alla Modifying-Blacklist. Le modifiche a questo ordine di hedging non verranno più apportate."));
return(Ticket);
}
}
what do you guys think? Can this work?