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!
See more
See less

Partner 728x90

Collapse

need support

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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 Jakub

    #2
    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

    Comment


      #3
      Hi Emily, can I send you an email with chart example? Thank you

      Comment


        #4
        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 DJ888, Today, 10:57 PM
        0 responses
        6 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        158 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Today, 09:29 PM
        0 responses
        7 views
        0 likes
        Last Post Belfortbucks  
        Started by zstheorist, Today, 07:52 PM
        0 responses
        7 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        151 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Working...
        X