This EA takes partial profit at half the value of your stop. e.g. if you stop is 50 pips, it will take partial profit at 25 pips.
This is my code for executing this function. It can't seem to recieve the ticket number though. I can see this because I put in Print(iTicket); and it prints a 0. Thus without the ticket number it won't partially take profit.
Does anyone know how to remedy this?
memorizeH[1] is resistance
memorizeL[1] is support.
Please find code below.
This is my code for executing this function. It can't seem to recieve the ticket number though. I can see this because I put in Print(iTicket); and it prints a 0. Thus without the ticket number it won't partially take profit.
Does anyone know how to remedy this?
memorizeH[1] is resistance
memorizeL[1] is support.
Please find code below.
Inserted Code
if(OrdersTotal()!=0) { tradeThisCandle=true; OrderSelect(iTicket, SELECT_BY_TICKET); if(OrderType()==OP_BUY) { rememberTP=(memorizeH[1]+0.0001)+((memorizeH[1]-memorizeL[1]+0.0003)*TP); if(Bid>=rememberTP) { OrderClose(iTicket, lotsTP, Bid, 1*0.0001); Print(iTicket); endLoop=true; } } if(OrderType()==OP_SELL) { rememberTP=(memorizeL[1]-0.0001)-((memorizeH[1]-memorizeL[1]+0.0003)*TP); if(Ask<=rememberTP) { OrderClose(iTicket, lotsTP, Ask, 1*0.0001); Print(iTicket); endLoop=true; } } }