Quote:
Originally Posted by 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:
PHP Code:
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)))
{
Decision code before a sell:
PHP Code:
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!