• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
    Patrick H.NinjaTrader Customer Service

    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 priceisking, Today, 12:51 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Started by chartish, Today, 10:33 AM
              3 responses
              18 views
              0 likes
              Last Post chartish  
              Started by casabella, Today, 11:51 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Started by Johnny, Today, 11:42 AM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Jermaine  
              Started by habibalex, Today, 09:03 AM
              2 responses
              14 views
              0 likes
              Last Post sledge
              by sledge
               
              Working...
              X