Martingale EA - page 76

 
ElectricSavant:
Folks,

I may need your help...wolfe has a very bad temper and he may beat me...

ES

You made me laugh! I'm back for a little while here, and am currently trying to get caught up. I'll try to answer all of your questions.

 

no questions yet... just starting to test.

I guess I will know by morning what type of mess this is going to be

I like it so far. --- not entire sure how the hedging will work ... but shows promise.

 
kayvan:
wolfe is there any setting to have, long-short balance ,with kayvan method , together?

Yes, one thing that won't work with long-short balance though is Choose_Own_Progression.

You must only choose ONE of these to be true:

Double_Lotsize

Long_Short_Balance

Choose_Own_Progression

Long_Short_Balance works like this:

Your first order will be whatever your Start_Lot_Size is set at. When it comes time for Long_Short_Balance to work it will balance your long and short lot sizes so they are fully hedged, plus add what ever amount you have selected for Balance_Weight, to the side with the trend.

I hope this makes sense.

Things could be changed later, but as of right now, this is how it works.

 

Due to all the confusion, that I was sure would happen with all these options, I will probably code a bunch of annoying pop-up alerts to notify users if they have combinations that won't work properly. This could take time though, because I will have to figure out all the bad combinations possible.

 
ElectricSavant:
Will you post the correction to the opening post later? (Bug#1?) ES

I'll notify you when this correction is complete. I want to test it before posting.

 
ElectricSavant:
Perhaps wolfe will be upgrading maxtrades to work with Percent and Dollar also...if not implemented already.

All maxtrades considers right now is total orders opened. We could code it to take into consideration $, or some type of percentage if people thought this would be useful. Anything you think of CAN be coded, the question is, if I can figure it out.

 
Beno:
Very stupid question

BUT

How do we know what has triggered the trade to close.

As there are several exit strategies.

No stupid questions. It's hard to know if you didn't code it.

Right now, there is NO exits based on any kind of an indicator.

ES was right:

- TS

- Percent

- Dollar

- Maxtrades

 

ok...so maxtrades works independently...the TS did not work together with it though?

ES

wolfe:
All maxtrades considers right now is total orders opened. We could code it to take into consideration $, or some type of percentage if people thought this would be useful. Anything you think of CAN be coded, the question is, if I can figure it out.
 
ElectricSavant:
wolfe,

I wanted to ask you about the all powerful LastEntryFilter. I want to make sure it functions the way I hope it does..

When used with the kayvan method it is supposed to not enter any entry that does not EXCEED the previous entry (s) in that same direction, cumulative.

So how in the world did you code this? as you need to know the lookback...the lag....the highest of ALL the previous entries that are open and the lowest...you do not even know how many are going to be opened. (folks I want to remind you that this can be used on the M5 too! if wolfe can get this to work)

anyways..the end result will give you exceding Longs going higher and higher and exceeding Shorts going lower and lower if pyramid: true...a gridding sort of look...opposite for counter trend..or in other words, pyramid: false

How do you control the first trades? what if the first trade is Long...and it does very well but does not exit then we get a Short which is the first leg....there are not any previous entries yet for the LastEntryFilter to work with but the Short is above the Long and your in pyramid mode?

Do you see the problem? Maybe you already delt with this? If you have not...how in the world will you? Don't answer that...

ES

P.S. be patient folks we are getting there step-by-step...this public testing is two-fold...it teaches you how to use this EA.

ES-

I do think you get a special award for contributing the hardest idea to code!

I had to create a way to keep track of the last buy open price, and the last sell open price, and be sure the program could access them when needed. It was kinda a pain in the a**! But I think I figured it out.

Another problem was integrating this along with the other options, and trying to guess "Hmm what might people have selected, or not have selected, and still have this work.

Decision code before a buy:

if (((Pyramid==true)&&(Use_MA_Entry==false)&&(Ask >= Next_Buy)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==false))||

((Pyramid==false)&&(Use_MA_Entry==false)&&(Ask <= Next_Sell)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==false))||

((Pyramid==true)&&(Use_MA_Entry==false)&&(Ask >= Next_Buy)&&(Ask>Last_Buy)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==true))||

((Pyramid==false)&&(Use_MA_Entry==false)&&(Ask <= Next_Sell)&&(Ask<Last_Buy)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==true)))

{[/PHP]

Decision code before a sell:

[PHP]if (((Pyramid==true)&&(Use_MA_Entry==false)&&(Bid <= Next_Sell)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==false))||

((Pyramid==false)&&(Use_MA_Entry==false)&&(Bid >= Next_Buy)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==false))||

((Pyramid==true)&&(Use_MA_Entry==false)&&(Bid <= Next_Sell)&&(Bid<Last_Sell)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==true))||

((Pyramid==false)&&(Use_MA_Entry==false)&&(Bid >= Next_Buy)&&(Bid>Last_Sell)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==true)))

{

These may look the same to you, but look closely, they're not.

I'm confident it works well when pyramid is set to true. I'm not so confident it will work all that great when pyramid is set to false. When pyramid is set to false, you have to take think of everything as opposite, it gets very confusing. You also have to take into account how the code should read before a long or a short. I did my best at the time on this one, Maybe my best will be better in the future.

I probably haven't really answered you're question, but I hope I did!

 
ElectricSavant:
ok...so maxtrades works independently...the TS did not work together with it though? ES

Not yet, you should have this tonight though.