Thread: Martingale EA
View Single Post
  #726 (permalink)  
Old 02-24-2008, 05:26 PM
wolfe's Avatar
wolfe wolfe is offline
Senior Member
 
Join Date: Jan 2006
Posts: 808
wolfe is on a distinguished road
Quote:
Originally Posted by ElectricSavant View Post
I took a slice of the setfile I am using, below in quotes, to go over this...

Trade#1: 0.1 lots
Trade#2: 0.2 lots
Trade#3: 0.4 lots
Trade#5: 0.8 lots
Trade#6: 1.6 lots
Trade#7: 3.2 lots
Trade#8: 6.4 lots
Trade#9: 12.8 lots
Trade#10: 25.6 lots

Now here is my question...Should maxtrades be set to 10...and will closeallmax exit and get flat on all the trades on the attempt to make the 11th trade?
Here is how Close_All_Max works:
PHP Code:
if (Close_All_Max==true)
 {
  if (
OTBM(Magic_Number)==Max_Trades)
   {
    
CBM(Magic_Number); 
Basically this code says this:
if Close_All_Max is true and your open orders total equals your Max_Trades total, a close all will be performed.

Congratulations ES, you have helped me find the first bug! The bug is this- if you have Use_Trailing_Stop set to true, the Close_All_Max will not work. This is easy to fix. Thanks ES.
Reply With Quote