NexusFi: Find Your Edge


Home Menu

 





About alerts for intraday high price renewals


Discussion in MultiCharts

Updated
    1. trending_up 1,706 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 16 posts
    2. attach_file 3 attachments




 
Search this Thread

About alerts for intraday high price renewals

  #1 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3

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.

 
Code
variables: var0( 0 ) ; 

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 ;

Attached Thumbnails
Click image for larger version

Name:	2023-03-16 intraday high.png
Views:	64
Size:	103.3 KB
ID:	330493  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Exit Strategy
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

LW11041104,

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:
 
Code
if CurrentBar > highBarNumber then //this will only allow the alert to trigger if the last bar did not already make a new high
   Alert ;

var0 = High ;
highBarNumber = CurrentBar ; //we store the bar number of the current high update here, after the alert check
highBarNumber would be a new variable here that you would have to declare within your code.

Regards,

ABCTG




LW11041104 View Post
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.

 
Code
variables: var0( 0 ) ; 

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 ;


Follow me on Twitter Reply With Quote
  #3 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3


Thank you for your reply.

I have modified the code as follows for the code I asked about, is it correct?

 
Code
variable:var0(0), highBarNumber(high);

if CurrentBar > highBarNumber then    
   Alert ;

   
var0 = High ;
highBarNumber = CurrentBar;

Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

LW11041104,

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 View Post
Thank you for your reply.

I have modified the code as follows for the code I asked about, is it correct?

 
Code
variable:var0(0), highBarNumber(high);

if CurrentBar > highBarNumber then    
   Alert ;

   
var0 = High ;
highBarNumber = CurrentBar;


Follow me on Twitter Reply With Quote
  #5 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3

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.

Attached Thumbnails
Click image for larger version

Name:	スクリーンショット 2023-03-24 Attached ima.png
Views:	52
Size:	31.3 KB
ID:	330544  
Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

LW11041104,

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 View Post
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.


Follow me on Twitter Reply With Quote
  #7 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3

Thank you for your reply.

We will try the various things you have indicated and will contact you again.

Reply With Quote
  #8 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3

I am contacting you because of the verification results after adding the code.

It seems that I was able to achieve what I hoped for.
Thank you very much for helping me.

Reply With Quote
Thanked by:
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

LW11041104,

I am glad to hear that. Feel free to post the final code in the interest of helping other futures.io members.

Regards,

ABCTG


LW11041104 View Post
I am contacting you because of the verification results after adding the code.

It seems that I was able to achieve what I hoped for.
Thank you very much for helping me.


Follow me on Twitter Reply With Quote
  #10 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3


Thank you for your assistance.

Here is the code.
Best regards.

 
Code
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 ;

Reply With Quote




Last Updated on April 10, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts