Martingale EA - page 71

 

wolfe,

Please excuse my numerous questions...I just want to make sure. Will this combination below give me a trail starting when the float reaches $6 bucks and exit me at $5 bucks, assuming it didn't lock in any more profit?

Use_Trailing_Stop=true

Trail_Start=6.0

TSLoss_Percent=83.4

Close_By_Profit=99999.0

Close_By_StopLoss=99999.0

ES

 

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?

Start_Lot_Size=0.1

Lot_Size_Increment=0.1

Long_Short_Balance=false

Balance_Weight=0.1

Double_Lotsize=true

Choose_Own_Progression=false

Trade_1=0.0

Trade_2=0.0

Trade_3=0.0

Trade_4=0.0

Trade_5=0.0

Trade_6=0.0

Trade_7=0.0

Trade_8=0.0

Trade_9=0.0

Trade_10=0.0

Trade_11=0.0

Trade_12=0.0

Trade_13=0.0

Trade_14=0.0

Trade_15=0.0

Trade_16=0.0

Trade_17=0.0

Trade_18=0.0

Trade_19=0.0

Trade_20=0.0

Max_Trades=10

Close_All_Max=true
 

The first thing you can say to me after giving you this for FREE is

kayvan:
most of it`s options dose`t work.

kayvan, how can I help you when I don't even know what it is you tried to do?

kayvan:
wolfe ,please help

Did you run a back test? The market isn't even open yet.

 

wolfe,

I think this is a language problem...more than it being whining...

wolfe...let's see how kayvan responds...I really do not think that he meant anything derogatory..I think he was posting out of frustration. Try to understand that this is probably one of the most complex EA's undertaken publically in forex-tsd...I would place it in the top 10 for complexity.

Remember this is a global audience and English is not everybody's first language.

Also people talk to each other differently in various parts of the globe...wolfe I know you realize this...and I can see where the first response is the most important.

ES

P.S. I posted my setfile for all to see...but I wanted to give kayvan something to look at also without embarrassing him or putting the spotlight on him..I hope this helped.

wolfe:
The first thing you can say to me after giving you this for FREE is

kayvan, how can I help you when I don't even know what it is you tried to do?

Did you run a back test? The market isn't even open yet.
 

wolfe,

from what I can see...this chunk of code alone was so multi-tasking...

anyway's....if there are not at least 1 dozen bugs that we find it would be a miracle...there are several more chunks of code interlaced and it is just impossible to avoid them..

So please folks...FIND THOSE 1 DOZEN BUGS and wolfe do not be too sensitve about many bugs...we are here to help.

ES

wolfe:
Depends if you are using MA entry, or kayvan method, pyramid true, or pyramid false.

Basically a Long_Short_Balance would happen if your last order was a short, and you just got a signal to open a long. Or the other way around of course. This would happen only if Long_Short_Balance was set to true, and ALL other lot size decisions were set to false.

Right here is what I had to code JUST to determine the next lot size in a trade progression, depending on how the user set it up.

if (Double_Lotsize==false)

{

Lot_Size=LastLots+Lot_Size_Increment;

}

if (Double_Lotsize==true)

{

Lot_Size=LastLots*2;

}

if (Long_Short_Balance==true)

{

if (SellLots>BuyLots)

{

Lot_Size=((SellLots-BuyLots)+Balance_Weight);

}

else Lot_Size=LastLots+Lot_Size_Increment;

}

if (Choose_Own_Progression==true)

{

if(OTBM(Magic_Number)==1){Lot_Size=Trade_2;}if(OTBM(Magic_Number)==2){Lot_Size=Trade_3;}

if(OTBM(Magic_Number)==3){Lot_Size=Trade_4;}if(OTBM(Magic_Number)==4){Lot_Size=Trade_5;}

if(OTBM(Magic_Number)==5){Lot_Size=Trade_6;}if(OTBM(Magic_Number)==6){Lot_Size=Trade_7;}

if(OTBM(Magic_Number)==7){Lot_Size=Trade_8;}if(OTBM(Magic_Number)==8){Lot_Size=Trade_9;}

if(OTBM(Magic_Number)==9){Lot_Size=Trade_10;}if(OTBM(Magic_Number)==10){Lot_Size=Trade_11;}

if(OTBM(Magic_Number)==11){Lot_Size=Trade_12;}if(OTBM(Magic_Number)==12){Lot_Size=Trade_13;}

if(OTBM(Magic_Number)==13){Lot_Size=Trade_14;}if(OTBM(Magic_Number)==14){Lot_Size=Trade_15;}

if(OTBM(Magic_Number)==15){Lot_Size=Trade_16;}if(OTBM(Magic_Number)==16){Lot_Size=Trade_17;}

if(OTBM(Magic_Number)==17){Lot_Size=Trade_18;}if(OTBM(Magic_Number)==18){Lot_Size=Trade_19;}

if(OTBM(Magic_Number)==19){Lot_Size=Trade_20;}

}

RefreshRates();

Ticket=OrderSend(Symbol(),OP_BUY,Lot_Size,Ask,Slippage,NULL,NULL,"TFX_LONG_ADDITIONAL",Magic_Number,0,Green);[/PHP]

As you see it got very confusing, and it does have some limitations. Code reads right to left, top to bottom, just as you or I would.(only it does this in a nano second)

Now you can see the last decision method the code reads is this one:

[PHP]if (Choose_Own_Progression==true)

{

If Choose_Own_Progression is set to true, this is the last thing the code reads to decide which method for lot size it will use, all others that were true will not execute. Only the last one that the code read to be true.

Sorry if I just confused you more.
 

Just a thought...

Delete your include file folks...then install the new and improved 1.6...no include file needed. The opening post of this thread has your new download.

It is best just to start with a new demo....then everything is clear!

ES

 

wolfe,

You meant left to right...

right to left

 
ElectricSavant:
and wolfe do not be too sensitve about many bugs...we are here to help.ES

I fully expect there to be some set up problems with certain combinations of options selected. I do want people to bring them to my attention if found. The whole reason it got so complicated was trying to include as many people's ideas as possible.

I thought about coding a bunch of annoying pop-up alerts, so that when people chose an un-workable combination, it alerted them, and disabled trade. But, I didn't get around to that yet, I was anxious for people to have and test.

 

I may be out of line here...

But Newdigital...needs to give the keys to the Elite section of this Forum to wolfe...wolfe has earned it and should not have to pay...we need to take care of the coders here..

Newdigital...please

ES

P.S. will someone point newdigital to this post and support the idea?

 
ElectricSavant:
wolfe,

You meant left to right...

right to left

Woops! Even us wanna-be coders get confused!

Reason: