peatdexter:
Hi all,
I am really new to this EA things and programming.
Is it possible to put adjustable Stop Loss to EA.
Maybe something like this. Put 'True' if we want to use the adjustable Stop Loss. Put 'False' an it will follow the origin rules and logic.
Tq on your response.
yes possible
it is called "trailing stops"
try the below code, may help:
for(int cnt=0;cnt<OrdersTotal();cnt++) { int MyOrderSelect=OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES); if(OrderType()<=OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber ) { if(OrderType()==OP_BUY) { if(TrailingStop>0) { if(Bid-OrderOpenPrice()>MyPoint*TrailingStop) { if(OrderStopLoss()<Bid-MyPoint*TrailingStop) { int MyOrderModify=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*MyPoint,OrderTakeProfit(),0,Green); } } } } else { if(TrailingStop>0) { if((OrderOpenPrice()-Ask)>(MyPoint*TrailingStop)) { if((OrderStopLoss()>(Ask+MyPoint*TrailingStop)) || (OrderStopLoss()==0)) { int MyOrderModify=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+MyPoint*TrailingStop,OrderTakeProfit(),0,Red); } } } } } }
in case you want to get a top quality work then open a job in the freelance section.
Mohammad Soubra:
I'll take a look. Tq then.
yes possible
it is called "trailing stops"
try the below code, may help:
in case you want to get a top quality work then open a job in the freelance section.
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
Hi all,
I am really new to this EA things and programming.
Is it possible to put adjustable Stop Loss to EA.
Maybe something like this. Put 'True' if we want to use the adjustable Stop Loss. Put 'False' an it will follow the origin rules and logic.
Tq on your response.