Job finished
Specification
Apply just if you are experienced developer and can do the job really fast. I need to test the EA on live demo account (not a backtest) before I'll close a job what can take 10 -24 hour on working day and the part of hand over is a source code as well. Please not apply if you do not understand what I need.
here is what I need. the inputs for grid
first order to open: Buy, Sell, Both
order lot size
Stoploss in points, if 0 there is no SL
Takeprofit in points, if 0 there is no SL
Grid distance in points
magic number- have to work for all chart to use it for close all trades button
how should work a grid. We say I open Buy. set no SL and TP 50 point. grid distance 50.
market going up: when the grid trade reach a tp, trade will be closed immediately and replaced by new buy trade.
market going against me: when the trade reach a grid distance, first trade stay open and EA open new trade with same setting as first trade. n next stage (100 points) its open again another buy etc. On one grid distance is all the time just one trade in one direction. when the condition of market change and a third trade (or any) reach a TP that trade will be closed. Rest stay open till future action. So it can now second trade reach TP - same as before or market going again down so EA will open another trade in grid distance 50 point from last active trade. The grid opening is a endless loop.
if there is no more Buy trade - all closed on TP - EA will open new one straight away.
recovery trades:
recovery will be activate when number of grid trades is open in same direction ( for example 5 buy),
if I use example from above: there is first trade on start, 2nd on 50 points, 3rd on 100 points etc and I set a number 5 as start a recovery EA should open a recovery trade which will recover a trade with biggest lost - logically the first one. Lot size will be automatically calculated from TP I set for recovery trade and an actual loses on the first trade. If the TP of recovery reached, EA will close the first grid trade and a recovery trade. If SL of recovery trade reached, EA close just a recovery. Recovery have to be opposite direction as a grid trade. Process for that first trade recovery will be repeated till not reached TP of recovery trade but always just on the point where was activate first time.
Recovery have to be activate for all grid trade which reach a activation point. Recovery trade must be connected to the grid trade which is recovered.
recovery TP in points
recovery SL in points
Last thing is a button for close all trades from all charts on actual price.