Job finished
Specification
Ea based on pending hedge orders. Ea will start from first buy+sell order and place pending buysell orders above and below that starting point..as in the settings in put will be given for number of hedged orders and the distance between each buysell.
when ever a stop loss is hit all the other opened orders will also be closed . But ea will remain active with all other functions.
please keep in mind the buysell orders will be spread sensitive,,there should be a setting to set the spread..so if the spread is set to .8 then this will make hedge orders to be placed as
if buy stop is at 1.09350 then sell limit will be at 1.09342 and in the same way ..if the sell stop is at 1.09050 the buy limit will be at 1.09042 .the only thing required by this function is that there should not be a situation when ea opens a buy and sell is missed due to spread or a sell is opened and buy is missed,,so you can cover this function buy setting the ea to always open a buy+sell because single order will be never opened..
so every order will be in the form of a pair of buy+sell and 2 functions below are the most important..
1: every order will use break even ,sl, tp and trail but ..when both the orders are opened there will be only break even ..
sl , tp , and trail will only be activated when one of the orders has hit the break even and is closed.
suppose ..buy+sell was opened at 1.09200 at this point only break even will be activated for both positions. so if break even is 100 now say price goes high to 1.09300 and break even for buy position is active..till then no sl,tp or trail will be active . now if market comes back and hits the break even and buy position is closed this is the moment when tp ,sl and trail will be activated for the remaining sell position. so in short at first the buysell will only activate breakeven and when any of them is closed by hitting the break even so sl,tp and trail will be activated for the other position.
2::
when breakeven is activated for any of the position pending buy+sell will be placed again same at the price of previous buy+sell.
say ,,buysell was placed at 1.09300 after opening these orders market goes high and breakeven for buy is active so at that time a buy+sell will be placed again at 1.09300.