Trail

 

adding Trailing is not working ,please your help will be appreciated.

input bool UseTrailingstop=true; 

{Trail(Trailingstop,MinProfit,Trailstep); 

for (int x= 0;x<= OrdersTotal ()-1;;x++) 

bool r= OrderSelect(x,SELECT_BY_POS); 

intMagicNumber=OrdermagicNumber();

orderType=OrderType();

if (magicNumber=MagicNumber() 

     &&OrderType==OP_BUY ||OP_SELL 
         
{ Trailingstop(OrderTicket(), Trail,,Profit, Trailstep)}
check all manual orders with trailing stop for all open trades or with magic number ( the two option

Documentation on MQL5: Integration / MetaTrader for Python / order_calc_margin
Documentation on MQL5: Integration / MetaTrader for Python / order_calc_margin
  • www.mql5.com
order_calc_margin - MetaTrader for Python - Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Only post code that compiles. What you wrote is bable.
 
//input Paramters 
input int  TakeProfit = 100;
input int  Stoploss = 25;
input  double Lots =0.01
input bool UseTrailingStop = true; 
input int  TrailingStop =50;

its not compiling , help.

 
Mary A Thompson #: its not compiling , help.

Did you even look at the errors that the compiler reports?

//input Paramters 
input int    TakeProfit      = 100;
input int    Stoploss        = 25;
input double Lots            = 0.01;
input bool   UseTrailingStop = true; 
input int    TrailingStop    = 50;

You are missing a semicolon at the end of the 3rd input.

Style your code so that it will be easier to spot errors and logic problems.

 
Thank you
Reason: