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)
Highest high for specific bars - easylanguage code suggestion
this was just a suggestion so that you can easily familiarize yourself with the basics, as this can be helpful in learning EasyLanguage. Once you have the simple code working, you can easily adapt it to what you have in mind.
Regards,
ABCTG
Can you help answer these questions from other members on NexusFi?
If I remember well you have the functions HHV and LLV in easylanguage.
So the highest high of the last 5 bars would be HHV( H, 5 ), the lowest low LLV( L, 5 ),
the highest open HHV( O, 5 ) etc.
HHV and LLV are part of Metastock as far as I am aware, but maybe someone created them for Tradestation as custom functions, too. However you can accomplish the same using the built-in functions Highest and Lowest i.e. Highest( High, 5 ) would give you the highest high over the last five bars in EasyLanguage.
Hi edgefirst, thank you for your suggestion.. but my difficulty was in coding the command to find highest (high, 5) only among the bars previous to the current bars that have a minimum lower than the level x, that is the high of the current bar.
this is exactly what the code @edgefirst posted provides, just replace x with High.
You would also have to make k a variable and N could be an input with the value of 5.
Hi ABCTG ,
I have elaborated the code following the instructions but as you can see from the output HH is not calculated, I suppose something is wrong;
Lsetup = 0;
If C < L[1] and L = lowest(low,5) then Lsetup = H ;
end;
HH = 0;
for k = 0 to N-1 begin
if Low[k] < Lsetup and High[k] > hh then begin
HH = High[k];
hh_barsback = k;
end;
end;
print(File("C:\Users\utente\Desktop\outputMulticharts\test.txt")," symbol ",symbol," date ",date:7:0,spaces(2)," time ",time:4:0,spaces(2)," spaces(3)," lsetup ",lsetup,spaces(3)," hh ",hh);
check your values for Lsetup as they might prevent the code from finding values on bars you are checking.
It might make sense to take one step back by removing the "Low[k] < Lsetup" to confirm that the code is able to find the highest high within the lookback.
Once you know that this part is working correctly you can proceed in tracking down what is not working correctly when you re-introduce "Low[k] < Lsetup" to your rules.
HH = 0;
for k = 0 to N-1 begin
if {Low[k] < Lsetup and} High[k] > hh then begin
HH = High[k];
hh_barsback = k;
end;
end;
print(File("C:\Users\utente\Desktop\outputMulticharts\test.txt")," symbol ",symbol," date ",date:7:0,spaces(2)," time ",time:4:0,spaces(2)," lsetup ",lsetup,spaces(3)," hh ",hh);