hello every one the idea is as following
we will build a grid
that have
2 buy ( buy 1 and buy 2 )
2 sell ( sell 1 and sell 2 )
only
and every one of them has target : stop 2 :1
ok
look to the attached picture
the point number 1 is or start point and let's say that the price at this point is 100
and let say that the spread is 3 points
let's say i am going to open buy 1 at the point number 1 the order will be opened from point 2 ( price 103 due to spread )
and it's stop loss will be 20 point ( step ) at point number 6 ( price 80 )
ok if the stop loss hit how much pip i will lose ??
20 pip ( from 100 to 80 ) + 3 pip spread = 23
so i am risking to lose 23 pip
so i need to win 46 pip
so where will be my take profit for ( buy 1 ) ??
it will be at : 103 ( break even point ( point number 2 ) + 46 ( required win pip ) = 149 ( point number 5 )
ok that's where i will open buy 1 and where is it's sl an tp
buy 2 will opened from point 6 ( price 80 ) and sl at point 7 ( price 60 ) ant tp at point 4 ( price 129 )
sell 1 will opened from point 3 ( price 109 ) and sl at point 4 ( price 129 ) ant tp at point 7 ( price 60 )
sell 2 will opened from point 4 ( price 129 ) and sl at point 5 ( price 149 ) ant tp at point 6 ( price 80 )
and in case of buying : buy 1 will be opened as market order not pending and buy 2 , sell 1 and sell 2 will be pending
and in case of selling : sell 1 will be opened as market order not pending and sell 2 , buy 1 and buy 2 will be pending
the parameter of the expert should be :
-type : sell or buy ( to determine what will be open first )
-spread : number ( if i put any number here it will be the spread and if i leave it 0 the pread calculated automatically ( bid - ask ) )
-step : the number of pips between point 1 and point 6
-buy 1 sl : here i will put the amount of money that i want to loose for this trade ( the lot calculated by dividing the money by pips to lose )
example : as i say for buy 1 i will loose 23 pip ( 20 pip from 100 to 80 + 3 pip spread ) so if i make this parameter 46 then the lot of this trade will be 0.2 ( 2 dollar per pip )
-buy 2 sl : as illustrated
-sell 1 sl : as illustrated
-sell 2 sl : as illustrated
here some tips to help coding
- make an int lets name it ( distance ) and make it = spread*3
so buy 1 will be opened normally from the current price ( point 1 ) ( or later we may add a signal for entry )
it's tp will be at : current price ( point 1 ( price 100 ))+(2*step ) + distance
and it's sl will be at : current price ( point 1 ( price 100 )) -step
buy 2 will be opened at : current price ( point 1 ( price 100 )) - step
and it's tp at : current price + 1*step+distance
and it's sl at : current price ( point 1 ( price 100 )) - 2*step
sell 1 will be opened at : current price ( point 1 ( price 100 )) + distance
and it's tp at : current price - 2*step
and it's sl at : current price ( point 1 ( price 100 ))+ 1*step + distance
sell 2 will be opened at : current price ( point 1 ( price 100 )) +1*step + distance
and it's tp at : current price - step
and it's sl at : current price ( point 1 ( price 100 ))+ 2*step + distance
that's it
we will build a grid
that have
2 buy ( buy 1 and buy 2 )
2 sell ( sell 1 and sell 2 )
only
and every one of them has target : stop 2 :1
ok
look to the attached picture
the point number 1 is or start point and let's say that the price at this point is 100
and let say that the spread is 3 points
let's say i am going to open buy 1 at the point number 1 the order will be opened from point 2 ( price 103 due to spread )
and it's stop loss will be 20 point ( step ) at point number 6 ( price 80 )
ok if the stop loss hit how much pip i will lose ??
20 pip ( from 100 to 80 ) + 3 pip spread = 23
so i am risking to lose 23 pip
so i need to win 46 pip
so where will be my take profit for ( buy 1 ) ??
it will be at : 103 ( break even point ( point number 2 ) + 46 ( required win pip ) = 149 ( point number 5 )
ok that's where i will open buy 1 and where is it's sl an tp
buy 2 will opened from point 6 ( price 80 ) and sl at point 7 ( price 60 ) ant tp at point 4 ( price 129 )
sell 1 will opened from point 3 ( price 109 ) and sl at point 4 ( price 129 ) ant tp at point 7 ( price 60 )
sell 2 will opened from point 4 ( price 129 ) and sl at point 5 ( price 149 ) ant tp at point 6 ( price 80 )
and in case of buying : buy 1 will be opened as market order not pending and buy 2 , sell 1 and sell 2 will be pending
and in case of selling : sell 1 will be opened as market order not pending and sell 2 , buy 1 and buy 2 will be pending
the parameter of the expert should be :
-type : sell or buy ( to determine what will be open first )
-spread : number ( if i put any number here it will be the spread and if i leave it 0 the pread calculated automatically ( bid - ask ) )
-step : the number of pips between point 1 and point 6
-buy 1 sl : here i will put the amount of money that i want to loose for this trade ( the lot calculated by dividing the money by pips to lose )
example : as i say for buy 1 i will loose 23 pip ( 20 pip from 100 to 80 + 3 pip spread ) so if i make this parameter 46 then the lot of this trade will be 0.2 ( 2 dollar per pip )
-buy 2 sl : as illustrated
-sell 1 sl : as illustrated
-sell 2 sl : as illustrated
here some tips to help coding
- make an int lets name it ( distance ) and make it = spread*3
so buy 1 will be opened normally from the current price ( point 1 ) ( or later we may add a signal for entry )
it's tp will be at : current price ( point 1 ( price 100 ))+(2*step ) + distance
and it's sl will be at : current price ( point 1 ( price 100 )) -step
buy 2 will be opened at : current price ( point 1 ( price 100 )) - step
and it's tp at : current price + 1*step+distance
and it's sl at : current price ( point 1 ( price 100 )) - 2*step
sell 1 will be opened at : current price ( point 1 ( price 100 )) + distance
and it's tp at : current price - 2*step
and it's sl at : current price ( point 1 ( price 100 ))+ 1*step + distance
sell 2 will be opened at : current price ( point 1 ( price 100 )) +1*step + distance
and it's tp at : current price - step
and it's sl at : current price ( point 1 ( price 100 ))+ 2*step + distance
that's it