Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

on bar update in strategy builder

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

    on bar update in strategy builder

    I am creating a new strategy and have On Bar Update set. The strategy is using three different time frames set in "Additional Data" on an Instrument.

    The strategy now fires off an alert when certain conditions are met, great but I am trying to test out now for an order entry. The problem arises when every new bar when conditions are met would keep firing off order entries on bar update.
    I want only one order entry and to ignore further triggering of the condition until another condition would prevail and exit the market.

    As it is The strategy would keep making entries every time a new bar was to form on the three time frames when conditions are met, I just want the first order to trigger entry until a second condition was met to exit the market.

    Grateful for any help here, as I am finding my way around the Strategy builder.

    Thanks in advance and hope I have made myself clear!

    #2
    I am thinking I need a 4th Condition ?

    Strategy Builder/Conditions and actions.

    I have three conditions at present and that is the three time frames that trigger the conditions by the "If All " the following conditions are met.

    Indicator, instrument time frame and condition x in 3 time frames.

    So this triggers everytime the three conditions are met. I am trying to make it trigger just once when the three conditions are met.

    4th condition would be if triggered once don't trigger again ?

    Comment


      #3
      Hello fredfred123,

      Thanks for your post.

      You can add a bool variable (create this in the Inputs and Variables strategy builder window) that is set true initially (default setting). Add the check that the bool is true when all three conditions are true. In the actions section then you have your entry action and set the bool variable to false to prevent further orders.

      You will need another set that resets the bool back to true so that it will allow entry again when you choose.
      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Hi Paul

        Thank you so much, I've set that up and made another set to return the bool to true and testing it now!

        Truly fantastic and saved the rest of my hair!!

        Many thanks

        Comment


          #5
          works perfectly thank you so much !

          Comment


            #6
            One question?

            When I start the strategy up the Bool Variable will be at the default of True.
            when a trade is triggered the Bool is set to False.

            When the Trade is cancelled by the strategy the Bool Variable is reset to true so another trade is possible.

            If I interrupt and manually exit the trade The Bool variable would still be at False as the strategy had not canceled the trade and not reset the Bool variable.

            If I disable and re enable the strategy would that reset the Bool variable to True as it is the default condition?

            Many thanks

            Comment


              #7
              Hello fredfred123,

              Thanks for your reply.

              Correct, when you re-enable the strategy the bool will be set to true.
              Paul H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by caacapital, Today, 10:10 AM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_ShawnB  
              Started by DiverG20, Today, 10:23 AM
              0 responses
              21 views
              0 likes
              Last Post DiverG20  
              Started by SuneSorgenfrei, Today, 09:29 AM
              0 responses
              19 views
              0 likes
              Last Post SuneSorgenfrei  
              Started by dodoei, Today, 07:24 AM
              0 responses
              14 views
              0 likes
              Last Post dodoei
              by dodoei
               
              Started by thecashguys, Today, 06:13 AM
              0 responses
              13 views
              0 likes
              Last Post thecashguys  
              Working...
              X