How to make the TakeProfit as a percentage on MQL4?

 

Hello,


I need to make my take profit as on the fibonacci lines. I know its hard to use fibonacci on the EA. so I am trying to make it as percentage.

For example. I want the EA to calculate the highest candle, then make the take profit as 0.8* the total pips of the highest 2 or 3 candles.

I dont know how to make the EA read the percentage and how to make the order (Take profit) as a percentage.

Also I am facing a problem with calculating the pips of the candles. :)

I am not very pro in programming. So is there any professionals here who can advise?


Thanks in advance

 
Hi, I think you should create new order in "Freelance" section, this will be the fastest way to get this EA. Regards Greg
 

I think you can say pips1= close[0]-close[1] and pips2=close[2]-close[1] etc.

if pips1 > pips2 and pips1 is positive then use pips 1 etc.

or if pips 1 < pips2 and pips1 is negative then use pips1 etc.


then when you have your target you can *0.8 eg. pips1=pips1*0.8

you will add the current close price to the pips eg. pips1=pips1+close();

and then you can do OrderSelect(ticket,SELECT_BY_TICKET);

to select the order then you can do OrderClose(). Look up orderclose in help because I cant remember if it has parameters to go inside the brackets.

and for your ordersend when you open the order make ticket=OrderSend(…..)

but use no TP because the Orderclose() is the TP

 
Brian Rumbles:



I think you can say pips1= close[0]-close[1] and pips2=close[2]-close[1] etc.

if pips1 > pips2 and pips1 is positive then use pips 1 etc.

or if pips 1 < pips2 and pips1 is negative then use pips1 etc.


then when you have your target you can *0.8 eg. pips1=pips1*0.8

you will add the current close price to the pips eg. pips1=pips1+close();

and then you can do OrderSelect(ticket,SELECT_BY_TICKET);

to select the order then you can do OrderClose(). Look up orderclose in help because I cant remember if it has parameters to go inside the brackets.

and for your ordersend when you open the order make ticket=OrderSend(…..)

but use no TP because the Orderclose() is the TP



Thanks for your kind respond.


I have made an order for the freelancers. Maybe you would like to apply and get it done?

https://www.mql5.com/en/job/108821


Thanks

Damati

Freelance service at MQL5.com: I want my TP to be as percentage
Freelance service at MQL5.com: I want my TP to be as percentage
  • www.mql5.com
Hello, I want someone to create my TakeProfit as a percentage. MQL4 for MetaTrade4 I have all the inputs. I just need 2 things as below: 1) I need the robot to read my input. For example I am telling him: double PipsBuy1 = (Close [3] - Open [11]); (Its total pips of the mentioned candles) And candles without the tails. Is this an input he can...
Reason: