Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prevent entry at the same price level more than once within a session

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

    Prevent entry at the same price level more than once within a session

    Hi guys,

    I would like to ask if you could point me in the right direction as to how I could achieve the following.

    If within a session an order has already been executed at a particular price level I want to prevent the strategy entering another limit buy or sell trade at that previous level.

    Regards,
    suprsnipes

    #2
    suprsnipes, you would then need to save the price level for example to a variable and check if new orders outside of a certain range around this to be considered valid...then reset the variable on session breaks to 'arm' it for all trades to be considerd for the new day.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Can I achieve this within the strategy wizard?

      Comment


        #4
        Unfortunately this would require custom programming suprsnipes.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          What section of the NT help guide can you refer me to then?

          Comment


            #6
            You would either need to save your execution / entry signal prices to variables as you go, or access the IExecution's of the strategy directly through the Trade class - http://www.ninjatrader-support.com/H...radeClass.html
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks for the reply Bertrand,

              Is there a code snippet that you can provide?

              Regards,
              suprsnipes

              Comment


                #8
                Unfortunately I'm not aware of one related to this topic.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Could I use Position.AvgPrice?

                  If so to achieve this where would I need to add the code?

                  From what I have be reading this could possibly be both in the variables section as well as the OnBarUpdate section within NinjaScript?

                  I'm just a little uncertain as to where I should look to add the code I require...I looked into IOrder also but that seems like a more advanced level of programming.

                  Comment


                    #10
                    Position.AvgPrice would just give you the entry of the current, open position - you would need to access the history for positions you took to check if it falls within an already taken trade and thus it should not be executed.

                    This would indeed require some custom programming - perhaps it's good idea to contact a NinjaScript consultant to assist you -

                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by DJ888, 04-16-2024, 06:09 PM
                    6 responses
                    18 views
                    0 likes
                    Last Post DJ888
                    by DJ888
                     
                    Started by Jon17, Today, 04:33 PM
                    0 responses
                    1 view
                    0 likes
                    Last Post Jon17
                    by Jon17
                     
                    Started by Javierw.ok, Today, 04:12 PM
                    0 responses
                    6 views
                    0 likes
                    Last Post Javierw.ok  
                    Started by timmbbo, Today, 08:59 AM
                    2 responses
                    10 views
                    0 likes
                    Last Post bltdavid  
                    Started by alifarahani, Today, 09:40 AM
                    6 responses
                    41 views
                    0 likes
                    Last Post alifarahani  
                    Working...
                    X