Here let's join for martingale lovers, let's talk about coding about martingale.
As we know the general way martingale is to double the lot 2 times, but in its development this way more and more variations. Well there are often forgotten in our attention in this system, that is how to menclose position that is floating. I know there are 2 ways, namely:
1. Accumulated profit (this way is too dangerous when slippage occurs)
2. Trailing TP (this is the safest way in close position)
If for the accumulation of profit coding like this:
where tp_in_money is an extern double, nah a less know too, please correct me if I am wrong.PHP Code:
if(profit>=tp_in_money|| a>0)
{
closeall();
closeall();
closeall();
a++;
if(total()==0) a=0;
Well that's the problem I am coding for TP trailing that can be set for each level. For example:
In the input menu like this
TP 1 = 5
TP 2 = 10
TP 3 = 16
TP 4 = 21
TP 5 = 23
So when level 2 hit, then level 2 modify TP to 10 pips while level 1 TP it in modif to TP which equal to level 2
Then When level 3 hit, then level 3 modify TP to 16 pips while level 1 and 2 TP it in modif to TP same with level 3
so on .......
Coding is really confused, about how the master is here, can you help me ???