Lot function

 
Hello am new in programing.I want to create lot fonction where  if order is loss EA change initial lot to fix lot and after profit increase initial lot before return initial lot.
For exemple initial lot is 0.10.I want that after every loss EA change lot to 0.01 and after 0.01 lot if order is profit increase lot to 0.20 before return 0.1
 
Mq4_programing: Hello am new in programing.I want to create lot fonction where  if order is loss EA change initial lot to fix lot and after profit increase initial lot before return initial lot.
For exemple initial lot is 0.10.I want that after every loss EA change lot to 0.01 and after 0.01 lot if order is profit increase lot to 0.20 before return 0.1

Search the Codebase. There are many, many examples of code using Martingale (what you have described) and other types of "loss recovery" technique attempts.

However, please be warned that Martingale never wins in the long run!

 
Fernando Carreiro:

Search the Codebase. There are many, many examples of code using Martingale (what you have described) and other types of "loss recovery" technique attempts.

However, please be warned that Martingale never wins in the long run!

obviously, but it's not exactly a martingale but a kind of martingale.  I'm training and I need a helping hand.
 
Mq4_programing: obviously, but it's not exactly a martingale but a kind of martingale.  I'm training and I need a helping hand.

Then use the CodeBase. There are many code samples (good and bad) for you to study and learn from and see what to do and not to do.

 
Fernando Carreiro:

Then use the CodeBase. There are many code samples (good and bad) for you to study and learn from and see what to do and not to do.

great. that would help me a lot.
Reason: