Please modify APS-Hedging EA

 

Can someone please make the EA to do the following. It currently trades 24hrs a day nonstop. I would like to have it stop trading after a profit in dollars has been raeched. This could be called ProfitTarget and lets say ProfitTarget is et to 20 (dollars) and if profit is reached ea must stop trading until started again. Any help greatly appreciated. Thank you

Files:
 

Start again? How to start again if trade non stop?

 

Hi PANNEK, the ea currently trades all the time. What I would like is that if it made for example $20profit then all trades must be closed and the ea must stop trading. To make it trade again I would need to close MT4 and open it again. I hope I am making sense now. Thank you

 

Could someone please help. Thank you in advance

 
fxwealth:
Hi PANNEK, the ea currently trades all the time. What I would like is that if it made for example $20profit then all trades must be closed and the ea must stop trading. To make it trade again I would need to close MT4 and open it again. I hope I am making sense now. Thank you

Hi Fxwealth,

There are many EA's in Forex-TSD's archives that already have the code routines to close the trades and take profits...

You can search for them and add the "take profit and close trade" code to your EA.

BTW.... You don't need to close MT4 to stop the trading...just close the trades when they reach your profit level...and re-start trading when you want to...

To keep the EA active so you don't have to manually re-start the EA each time...

The key is to determine WHEN you want to start trading again...and add that to your code also.

For example...

Start trading after X hours or X days...or X bars have past...or any other criteria to re-start your trading...

Then you need to add this "re-start trades" criteria to your EA...

FWIW that EA looks like a de-compiled code...so you may not get help in changing that code but good luck...

Otherwise you may need to re-write the code so it's understandable for others...

Hope this helps,

Robert

 
fxwealth:
Could someone please help. Thank you in advance

here you go

UseTargetProfit switch to on/off operation.

TargetProfit profit in currency.

I expert take profit >= TargetProfit, stop to open new order and processes only open orders.

If all orders closed, expert start trade if restart metatrader.

aps-hedging_v.1.0targetprofit.mq4

 

Hi PANNEK, Thank you so much! I really and truely appreciate your assistance. Cosmiclifeform, I am not a programmer and do not have the necesary skills to be able even copy and paste code etc. Would have no idea where to even place the copied code. I got the ea from another forum where it is shared. I tried learning to code but found it very difficult. Thank you both PANNEK and cosmiclifeform.

Best rgds

 

HI there fxwealth. Im wondering is there any manual description for aps hedging EA , can u post it to forum in attachment form.

Thx a lot in advance

 

Hi waveraider, it starts trading by opening a buy and sell at 0.1 lots. thereafter it places buy and sell limit orders x pips away from where it opened original trades. Initially looked good but after doing more extensive tests not working well. Remember it doubles the lot sizes as it places new orders.

Reason: