Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now, It is 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 would like to receive an alert each time an intraday high is renewed, but if the intraday high is renewed consecutively as shown in the attached image, the alert will go off for the second bar as well.
I only want to receive alerts for the first bar where the intraday high is renewed.
Can you help answer these questions from other members on NexusFi?
if it the desired outcome is to allow a new alert whenever a bar makes a new high after at least one bar that did not make a higher high you can accomplish this by storing the value of Currentbar together with the high.
Then you can only trigger the alert if:
highBarNumber would be a new variable here that you would have to declare within your code.
if this is the entire code, it would not be correct. Without any comments in the code it is also hard to tell why you do what you do. Why is highBarNumber initialized with high for example?
In general, my post was meant as an addition to your code, not a replacement.
Apart from that, I would suggest testing code changes to see if they do what you have in mind. You can even use the bar replay feature to check it quickly.
Regards,
ABCTG
LW11041104
Thank you for your reply.
I have modified the code as follows for the code I asked about, is it correct?
variable:var0(0), highBarNumber(high);
if CurrentBar > highBarNumber then
Alert ;
var0 = High ;
highBarNumber = CurrentBar;
You can achieve this by saving the Currentbar value along with the high in previous answers. I was wondering if I should set the initial value of high to the highBarNumber variable.
Regarding the addition of code, I would appreciate it if you could tell me where to add it.
you should be able to achieve what you have in mind by adding parts from the code snippet I posted to your code in exactly the same locations where I added code.
highBarNumber is meant to hold a bar number value and while it probably will do no harm to initialize it with high, initializing it with 0 appears to be more appropriate here.
Regards,
ABCTG
LW11041104
Thank you for your reply.
You can achieve this by saving the Currentbar value along with the high in previous answers. I was wondering if I should set the initial value of high to the highBarNumber variable.
Regarding the addition of code, I would appreciate it if you could tell me where to add it.
variables: var0( 0 ),highBarNumber(0);
if CurrentBar > highBarNumber then
Alert ;
var0 = High ;
highBarNumber = CurrentBar;
if BarType <= 1 or BarType >= 5 then
begin
if Date <> Date[1] then
var0 = High
else if High > var0 then
begin
Plot1( High, "NewHi-D" ) ;
Alert ;
var0 = High ;
end ;
end ;