I tried to researched it, but I cannot really find any answers around. I have build simple indicator, based on time and closing price conditions. The problem is, that I don't really know how to implement rules for current developing bar or any bar after. The indicator has two pre-set levels (private double statement) and once condition is true, these levels are drawn until condition is false. What I really looking for is to set priority rule for these levels, for instance, if current developing bar[0] or any bar after, first touch level one, then do noting , but if current developing bar or any bar after first touch level 2 then level 1, indicator will execute my code. The indicator is set to calculate for each tick. Would you thing, you can guide me or help me to solve this puzzle? Thank you very much for your time! Have a great day! Rgds Jakub
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
need support
Collapse
X
-
need support
Hi NT,
I tried to researched it, but I cannot really find any answers around. I have build simple indicator, based on time and closing price conditions. The problem is, that I don't really know how to implement rules for current developing bar or any bar after. The indicator has two pre-set levels (private double statement) and once condition is true, these levels are drawn until condition is false. What I really looking for is to set priority rule for these levels, for instance, if current developing bar[0] or any bar after, first touch level one, then do noting , but if current developing bar or any bar after first touch level 2 then level 1, indicator will execute my code. The indicator is set to calculate for each tick. Would you thing, you can guide me or help me to solve this puzzle? Thank you very much for your time! Have a great day! Rgds JakubTags: None
-
Hello Jakub,
Thank you for your post.
You mentioned you have level 1 and level 2 as pre-set values. Correct me if I am wrong, but my understanding is if the current bar's price only touches level 1 you do not want anything to happen. It sounds like you are looking to set up a condition that checks if the price touches level 2, and then level 1, and you want the code inside of the condition to be executed at that point.
This could be done using a bool variable to check first if level 2 has been touched, and then setting that bool to true. Next, you can set a new condition that checks if the bool is true and if level 1 has been touched. I would be glad to create a code snippet to demonstrate this, but would like some clarification; by "touched" do you mean if the price has crossed above or crossed below the pre-set levels? If you are able to provide an example that would be helpful.
I look forward to your clarification.Emily C.NinjaTrader Customer Service
-
Hello Jakub,
Thank you for your reply.
Certainly; please feel free to email support[AT]ninjatrader[DOT]com. Please include "ATTN Emily" in the subject line along with a link to this forum thread in the body of the email so your request is routed to me.
I look forward to assisting you further.Emily C.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Mestor, 03-10-2023, 01:50 AM
|
11 responses
303 views
0 likes
|
Last Post
by z.franck
Today, 02:29 AM
|
||
Started by Padan, Today, 02:02 AM
|
0 responses
6 views
0 likes
|
Last Post
by Padan
Today, 02:02 AM
|
||
Started by bukowa, 11-09-2023, 06:07 PM
|
20 responses
407 views
0 likes
|
Last Post
by Adfra
Today, 01:36 AM
|
||
Started by yertle, Yesterday, 05:49 PM
|
2 responses
11 views
0 likes
|
Last Post
by yertle
Today, 12:12 AM
|
||
Started by kaywai, Today, 12:06 AM
|
0 responses
10 views
0 likes
|
Last Post
by kaywai
Today, 12:06 AM
|
Comment