How to code? - page 87

 
Michel:
I think you should have a solution here : https://www.mql5.com/en/forum/general

Thanks, I'm the #7.

ERROR: The handle is invalid

 

How to code ?

Hi all,

who can think of the program ?

- if Buy-Signal : open Buy-Order 1; 2; 3; ( I must wait if I will open several orders ? wait or sleep ?)

- if Sell-Signal : close Order 1

- if Sell-Signal 2 && close Order 1: close Order 2 & 3

Send PM?

Thanks

derumuro

 
sandfromsky:
Thanks, I'm the #7. ERROR: The handle is invalid

I can use a FTP client to finish this work. For example, "Super Flexible File Synchronizer". Make screen shot .gif first, use FTP client upload it realtime.

I think I am not a fool man.

 

Does anyone know how to code so that when you call an indicator in an EA it automatically attaches the called indicator to the chart your EA is attached to? This way it would visually be in the exact same time as what is being read by your EA.

Thanks.

 
wolfe:
Does anyone know how to code so that when you call an indicator in an EA it automatically attaches the called indicator to the chart your EA is attached to? This way it would visually be in the exact same time as what is being read by your EA.

You must attach both EA and indicator unless the indy is coded inside the EA.

FerruFx

 

Help

hello

how to code this:

I need to extract some info from last closed trade,

and after use some info from this last trade

ex:

if last trade profit >0 'lasttradeprofit = 1'

and if last trade <=0 'lasttradeprofit = 0'

lasttradeprofit = 1 // if last trade >0

lasttradeprofit = 0 // if last trade <=0

thanks

 

why comment(2 / 1) display 2 but comment( 1 / 2) display 0?

how to make comment(1 / 2) display 0.5 ?

thank you.

 

I threw together an adjust trailing stop function for EAs, can someone check it out?

//+-----------------------------------------------------+

//| adjust trailing stop |

//+-----------------------------------------------------+

void AdjustTrailingStop()

{

int orders = OrdersTotal();

for(int j=orders-1;j>=0;j--)

{

OrderSelect(j, SELECT_BY_POS);

int type = OrderType();

//-- Adjust trailing stop for BUYs

if (type == OP_BUY && OrderSymbol()==Symbol() && (OrderMagicNumber() == MagicNumber))

{

if (Ask-TrailingStop*Point > OrderOpenPrice() && Ask-TrailingStop*Point > OrderStopLoss())

{

OrderModify(OrderTicket(),OrderOpenPrice(),Ask-TrailingStop*Point,OrderTakeProfit(),0);

}

}

//-- Adjust trailing stop for SELLs

if (type == OP_SELL && OrderSymbol()==Symbol() && (OrderMagicNumber() == MagicNumber))

{

if (Bid+TrailingStop*Point < OrderOpenPrice() && Bid+TrailingStop*Point < OrderStopLoss())

{

OrderModify(OrderTicket(),OrderOpenPrice(),Bid+TrailingStop*Point,OrderTakeProfit(),0);

}

}

}

}
 

CHinGsMAroonCLK ea

hello

can anyone add sl for this expert .

Id like all orders have a fix sl

 
birami:
hello

can anyone add sl for this expert .

Id like all orders have a fix sl

hello

try this !

Reason: