Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I'm familiar with C# but I can't wrap my head around some EasyLanguage concepts and its hard for me to search for the answers to this type of question in forums or in the language reference guides.
Can someone explain how the EasyLanguage processor handles historical values (Hp[1],HP[2], IPeak[1]) below in the code when the lines are first encountered:
If Absvalue(Filt) > IPeak Then IPeak = AbsValue(Filt);
Does it just skip over until populated or use a zero in place of historical values? If it uses a zero then I assume the programmer must be very careful when developing equation otherwise you can get into a situation where assigning a zero will always result in zero.
For instance if IPeak[1] starts out as 0 then IPeak will stay 0 until Absvalue(Filt) != 0?
And HP will be this part of equation ((1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) ) first bar, then (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] second bar, then finally full equation after 3rd bar?
I occasionally find code I want to convert to c# so I have to handle these unassigned values differently and just not sure if I am understand the big picture
Can you help answer these questions from other members on NexusFi?
Easy Language has a setting referred to as "max Bars back". It uses these bars to initialize calculations.
So if maxbarsback=10, then strategy engine will not do any of the calculations/lookback until the 10th or 11th bar. So, it should handle what you are doing correctly.
Thanks for reply. I guess I understand that in terms of bars, but my confusion is with the historical values of the variables. So if maxbarsback = 10 in the HP equation that takes care of the Close[1], Close[2], etc but the engine must be making some assumptions about the HP[1], HP[2] in the same equation?
So the first part of the HP equation (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) can be handled by the historic bars, but not the 2nd and 3rd part of the equation since that is self referencing. So does it just assume 0 for HP[1] and HP[2] in that case?
I suggest you put a print statement in your code, and see what it is calculating. I've explained it, and you are not going to believe me (and that's ok, I'd want to see proof too), so I think you should try it and see. That will eliminate all doubts.
Ok thanks that is what I was thinking, just confused by the self referencing of equation in HP and Filt.
Sorry I was trying to figure it out in my head since I don't use platforms that run on easylanguage and can't test/print. It looks like multicharts has that capability so maybe I can test with that in future.