hi guys im looking for help

 

here is the scenario...

think at a once there are may be one open trade or set of open trades can be closed. so at that point i need to check at that time if account grows up or draw down. if it is a drawdown in next trade open (have a trail stop always). it should be increased the lotsize to cover the previous drawdown and trailing stop gap will be used for as a take profit kind of a thing at that time only (in covering the drawdown purposes).

i hope you guys understand wt iam taliking about. im still struggling in implementing that. any ideas are welcome....

 

If I understand you correctly you want to:

1)Set position stop loss once your account equity starts declining

2)Increase position volume (lots) if your account equity starts increasing as a result of your opened position. Right?

Both these situations do suggest you need a custom buffer that logs your account equity. One of the ways of realizing this could be by creating static arrays whose size you extend on each new bar to store your most up to date equity...

alternatively you could simply monitor the position's profit under... I think this is under

OrderProfit();
 
MickGlancy:

If you want to close all open trades at once, I can give you an EA that does that for you.

other than that I am not clear on what you want. If you can think your logic through and retype it out that would be better