Martingale EA - page 42

 
ElectricSavant:
Well..kayvan...lets hope we get something to test...there is plenty of room in the opening post for several versions...

I will try them all, as long as wolfe is willing to try!

Your enthusiasm is refreshing...kayvan...I seem to need a young traders excitement lately to keep my interest in Forex and the search!

ES

don`t search .you won`t find anything , i did a lot , but i find nothing except loosing my money .new search ,new holly grail finding and new more loosing money.

i am not kayvan, i am his father ,and age near 60 . but why i have such a enthusiasm like a young trader . i think that`s because of my loosing (killing a lot of accounts that i don`t remember how many !!!! in about 6 years) in forex.that was all i find from searching .

but I belive there is away (the only way) that we can get money from forex

while we are always in trade .keep your hope, and let your enthusiasm also make refreshing the thread. have a good time .

 
waltini:
Hi Wolfe,

in an attempt to keep drawdown to a minimum I have coded in a break Even and a trailing stop. I can use either or both. It works well enough but I did it late last night and am still mucking around with the best settings.

I am more than happy to post it but it is your thread and it is disruptive to post a heap of private versions.

So I can either send it to you privately or post it if you are interested.

Oh and I have also limited the maximum lot size as an external.

My next thoughts are to limit the amount of orders in a sideways market and only allow extra orders on a price breakout.

I like your ideas here, I have been experimenting with a TS myself. I don't mind if you want to post your version. I welcome all new ideas. If you don't wish to post, I would love to look at your code. I always learn something new from other coders. Check your PM.

 
kayvan:
i beg you to do this changes to your ea

Don't beg! Take it easy, I'll give it a try. Be patient.

kayvan:
believe me it will be a perfect ea with this changes please do it

You say you want these changes to the EA. These are not "simple" changes, more like a completely different EA. I have been getting many requests for coding lately, so again be patient. I'll get to it.

kayvan:
:our first order with initial entry (say .1 & buy) active d we do nothing at the next bar and second next bar & third next bar &&&&&..... till price return 2 pips below the previous bar .then we enter sell with double size ,and continue to this every time this break out happened.

To verify, we are always looking at the previous bar high and previous bar low from the current bar for the break out trigger? Also, are we DOUBLING each progression, or just adding 0.1 each time? 0.1, 0.2, 0.4... OR 0.1, 0.2, 0.3...? Are we simply exiting the trade with an external TP variable?

 

wolfe, did you ever get that ts programmed. Otherwise, it will be difficult to make this a profitable adventure.

 
ajk:
wolfe, did you ever get that ts programmed. Otherwise, it will be difficult to make this a profitable adventure.

Yes I did. I'm still testing it. Seems to be working.

It looks something like this-(this part keeps track of your highest profit in the cycle)

Total_Profit=OPBM(Magic_Long)+OPBM(Magic_Short);

if (Trailing_Stop==true)

{

Open_Profit=Total_Profit;

Highest_Profit=GlobalVariableGet(TFX_Highest_Profit);

if (Open_Profit > Highest_Profit)

{

Highest_Profit=GlobalVariableSet(TFX_Highest_Profit,Total_Profit);

Highest_Profit=GlobalVariableGet(TFX_Highest_Profit);

Loss_Percent=TSLoss_Percent*0.01;

Print(" Loss percent = ",Loss_Percent);

Allowed_Loss=GlobalVariableGet(TFX_Highest_Profit)*Loss_Percent;

Allowed_Loss=GlobalVariableSet(TFX_Allowed_Loss,Allowed_Loss);

Allowed_Loss=GlobalVariableGet(TFX_Allowed_Loss);

Print(" Highest Profit = ",Highest_Profit);

Print(" Allowed Loss = ",Allowed_Loss);

}

}[/PHP]

And this part handles the closing of a cycle-

[PHP]if ((Trailing_Stop==true) && (Trail_Engaged==true))

{

if (OPBM(Magic_Long)+OPBM(Magic_Short) <= (GlobalVariableGet(TFX_Highest_Profit)-GlobalVariableGet(TFX_Allowed_Loss)))

{

while(OTBM(Magic_Long)+OTBM(Magic_Short)>0)

{

CBM(Magic_Long);CBM(Magic_Short);

}

if (OTBM(Magic_Long)>0)

{

Sleep(1000);CBM(Magic_Long);

}

if (OTBM(Magic_Short)>0)

{

Sleep(1000);CBM(Magic_Short);

}

if (OTBM(Magic_Long)+OTBM(Magic_Short)==0)

{

GlobalVariableSet(TFX_LastTicketL,0);

GlobalVariableSet(TFX_LastOpenL,0);

GlobalVariableSet(TFX_LastLotsL,0);

GlobalVariableSet(TFX_LastTicketS,0);

GlobalVariableSet(TFX_LastOpenS,0);

GlobalVariableSet(TFX_LastLotsS,0);

GlobalVariableSet(TFX_Highest_Profit,0);

GlobalVariableSet(TFX_Allowed_Loss,0);

}

Highest_Profit=GlobalVariableGet(TFX_Highest_Profit);

Allowed_Loss=GlobalVariableGet(TFX_Allowed_Loss);

Trail_Engaged=false;

}

}

I don't want to post until further testing is satisfied. Plus I have some more ideas for it.

 
ajk:
very nice coding! original. --- There is some merit in this type of thinking... I think The last order in the line should be a fast one. -- right before the market turns. I always appreciate coders who can do the order processing logic effectively -- not an easy task to make work properly. To a certain extent, we are trying to profit out of random... basically take your "run and get out" before the market decides to b slap ya around..

Thanks for the compliments ajk. The TS does seem to work properly, just not sure if it is plugged into the right EA method!

 

very nice coding! original. --- There is some merit in this type of thinking... I think The last order in the line is the loser so---- The processing logic hopefully will be effective. -- not an easy task to make work properly. To a certain extent, the ea tries to profit out of random... basically take your "run and get out" before the market decides to b slap ya around..

 
kayvan:
no mater which pair it will sweep the market

All right kayvan, here is the first crack at your idea. Have a try, I'm still not sure if this is EXACTLY what you are looking for.

Have a look at a visual back test shot of your method-

Give it a try, I'm sure this is not finished yet. Very roughly changed to try and fit your idea.

 
wolfe:
All right kayvan, here is the first crack at your idea. Have a try, I'm still not sure if this is EXACTLY what you are looking for.

Have a look at a visual back test shot of your method-

Give it a try, I'm sure this is not finished yet. Very roughly changed to try and fit your idea.

thanks a lot for all you have done , wolf . I made some forward test today ,there are some error in taking position . that i `ll try to show them in the charts attached below. i actived ea a little after crossing below cnndle 7 in my mt4 time .the first position was sell @1.9572 @8.35 in h1 ok . but as you see we have the second position opened buy @1.9597 . this is false .why? because the price did`t cross the previous candle (2 pips+spread ).as you see in the picture those 2 bars( 9 and it`s previous 8 ) have the same high point (1.9597).so this buy order must not opened at that point.

and also you can see we have a sell order opened @ 1.9567 while price did`t cross previous bar 2 pips below( in sell order no need to add spread)

.

in the second picture we have 1 buy order actived @ 1 .9583 while our previous bar high point is 1.9586 . it must be opened @ 1.9591(2pips plus spread).

any way in third picture you can see the result. thanks again and waiting for corrections.

Files:
 

Waiting patiently for the kayvan/wolfe/Lcfx EA...

You guys are BRILLIANT!

ES

Reason: