Reset the order values? what i am doing wrong? - page 2

 
sheriffonline:
I am writing code for loss recovery trade.

when order closed with loss the next coming orders do the multiple orders till it closes with profit(take profit).
after loss first trade open = (0.01)*2=0.02
if loss continues second trade open= (0.01+0.02)*2=0.06
if loss continues third trade open=(0.01+0.02+0.06)*2=0.18
if loss continues four trade open=(0.01+0.02+0.06+0.18)*2=0.54

Hello,

before going on with code, are you sure your recovery method is what you are really after? A typical recovery (Martingale) system should be in the lines of

a. If you only wanted to zero losses, after 1st trade of 0.01 lots it should be 0.01>0.01>0.02>0.04>0.08>0.16 and so on

b. for having  a win of the size of the original trade, say 0.01 lots, the above becomes 0.01>0.02>0.04>0.08>0.16>0.32 (that reads, one more iteration before blowing account :) ) 

 So, I suspect that your calculations are flawed, as you are getting a gigantic increase of lots in each step as per your logic. Am I right? 

 

best regards 

 
GumRai:
What does it print?
sheriffonline:
it prints 2015.09.15 21:47:39.687    2015.09.15 19:17  temp EURUSD,M15: 0.01
 all time

And what do you expect it to print?

Are there actually any closed orders with the symbol and Magic Number?

If there are, did the last closed trade close with profit or loss? 

Reason: