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

Reversal bar

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

    Reversal bar

    Anyone can help, how can I create a simple strategy, entry with reversal bar long/short, with toglle enable/disable with ninja 8?

    Thank you

    #2
    Hello Adolfo,

    Thank you for your post.

    Please describe further the following items:
    • Define reversal bar as you would like to see it.
    • Detail what you mean by "reversal bar long/short".
    • What do you mean enable/disable? As in the normal function in the NinjaTrader UI?

    I look forward to your response.

    Comment


      #3
      Hi PatrickH,

      Thank you for your reply,

      what I mean is a simply enable/disable the strategy when the price reaches certain level for example if hit a resistence, toggle "sell next reversal bar" or support "buy next reversal bar".
      Don´t know if there is a way to create two buttons in the GUI panel with that.

      Thanks

      Comment


        #4
        Hello Adolfo,

        We have an example that adds some buttons here: https://ninjatrader.com/support/help...trolcollection

        This could be used to set a bool variable from the button event handler. After setting the bool variable to true, In other parts of your logic, check if that bool variable is true and if so do your logic or dont do the logic based on the value of the variable.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank you Jesse,

          This is exactly what I want, but as I have no experience in ninjascript, what part of the code do I have to modify for example when I click "long" in advance the order is only executed when there is a reversal bar up and vice versa for short.

          Thank you

          Comment


            #6
            Hello Adolfo,

            Thank you for the reply.

            In case you have no experience with NinjaScript, this would be a more complex item to create. The Buttons event handler would be where your logic would go: OnMyButtonClick

            Inside of the event handler, you could do whatever logic you need to trigger the next event. The button handler applies to both buttons as shown in the sample so you would need to filter which clicked it by the buttons name.

            When working with event handlers this may also entail that you use TriggerCustomEvent because the buttons event handler is out of the event driven context. This ensures the prices used are correct at the time the button is pressed.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thak you I´ll try

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Barry Milan, Today, 10:35 PM
              2 responses
              8 views
              0 likes
              Last Post Barry Milan  
              Started by WeyldFalcon, 12-10-2020, 06:48 PM
              14 responses
              1,428 views
              0 likes
              Last Post Handclap0241  
              Started by DJ888, Yesterday, 06:09 PM
              2 responses
              9 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              41 views
              0 likes
              Last Post jeronymite  
              Started by bill2023, Today, 08:51 AM
              2 responses
              16 views
              0 likes
              Last Post bill2023  
              Working...
              X