工作已完成
指定
OctaFX parameters:
5 digits so 1,12005-1,12004=1point; 1 pip = 10 points
open position at 0.01 lot is 5 EUR used margin
hedging allowed
one buy +one sell open positions is 5 EUR used margin
part1.
main routine of the EA:
a)at the market price open buystop and sellstop pending orders at distance of 23 points from current price, when one pending is activated the other gets canceled and two new buystop and sellstop pendings are put in place
why 23 points? OctaFX spread is from 8 to 11 points on eurusd plus 10 points take profit is 21 points. ideal condition is where only one position is open at a time
a position is closing into TP (or trailing with lock profit) at 21 points and another position is beeing open at 23 points
b)when one pending order is activated the remaining one must be canceled and two new pending buystop and sellstop must be put on the current price. the distance is same 23 points
SCENARIO:
price 0 - order buystop and sellstop at 23 points distance
price up +23 from initial - the buystop gets activated while the sellstop gets canceled, a new buystop and sellstop are ordered from current price distance of 23
price up +46 from initial - previos position gets trailing up while locking profit, a buystop gets activated the sellstop gets canceled two new pendings are set at same 23 distance
price down +23 from initial - previous trailed position is closed with the lock profit, the previous buy is in -34 floating loss, the sellstop is activated, the other pending is canceled and two new pending orders are put here at same distance
price down 0 from initial - previous buy is in -57 floating loss, the previous sell locks 10 profit and trail, a new sellstop is activated while the buystop is canceled and two new pending orders are put in place
price down -23 from initial - the hanging buy is at -80 points floating loss, two sell positions are acumulating by trailing the profits, a new sell is activated, the buystop is canceled and two new pending orders are put in place
part2.
secondary routine of the EA: exiting the hanging floating loss positions
when one open position gets to -200 floating loss activate this routine of the EA, assign the position to a group and open new position in same direction on the current price to average down
consider fibbonacci series in the lot volume: 1,1,2,3,5,8,13,...etc.
pyramiding down
SCENARIO:
one buy position gets to -200 points loss
assign it to group 1 and open a new buy also assigned to group 1
modify both positions to close when BreakEven+number of positions*10points
price goes down to -400 points loss original position
open a third position at 2x lot and modify all 3 positions to close at breakeven+number of positions*10points
price goes down to -600 points loss original position
open another buy at 3x lot and modify all 4 positions in the group to close at breakeven + number of positions*10points
ideally within 6-7 positions in the group the price bounce up 20-25% even for a second within the downfall trend and all positions in the group close at minimum profit of 10 poits per each position
all this while the main routine of the grid sclaper gets minimum 10 points profit at every 23 points step of the price
if more than one position gets to -200 the second subroutine of the EA assign each of them to a new group. group 1, group 2, etc.
if one position is already part of one group and goes to -200 points do not create a new group, it is already in play in her group.
part 3.
account protection (money management)
after initial place of pendings buystop and sellstop consider this limitations:
no orders are open when marginlevel less than 400%; print message with current margin level
no orders are open if used margin equal or more than 20% of total balance; print message with current used margin
if all open positions are in a floating profit of 10points*number of positions then close all and start from zero
part4
trailing
a)
each position in the grid is intended to get 10 points profit minimum only in a fast scalping way
trailing for each position must be activated only at the 10 points profit to lock in
if price goes in the favourable direction we keep the position open to trail and lock more profits in
if price goes against the minimum 10 points gain for position must be locked
b)
each position in the second soubrutine (the group averaging down) is meant to take 10 points of profit minimum.
trailing should trail not the sing position but the group in order to take profit 10points minimum* number of positions in the group