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
in general the code should give you the same results in both indicator and strategy and the code from my previous post works fine within a strategy on my end.
You can utilize i_SetPlotValue and i_GetPlotValue to exchange values between a strategy and an indicator on the same chart and plot the values. This can help in tracking differences down.
Hi ABCTG, thank you for your seggestion, i've tried the code like indicator and it works,even if it doesn't calculate what it should be.
This is the what i've elaborated, how you can see it does not work.
Lsetup = 0;
If C < L[1] and L = lowest(low,5) then Lsetup = H ;
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;
If hh <> 0 then begin
IF C[1] < hh and C > hh then buy next bar at market;
IF marketposition > 0 then hh = 0;
end;
Setstopcontract;
setstoploss(MyStop);
as previously suggested, check your values for Lsetup as they might prevent the code from finding values on bars you are checking.
You might also want to consider if it could make sense to store the value of 'hh' in an additional variable, which only gets reset
after an entry.