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

capture Strategy position ENTRY by bar

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

    capture Strategy position ENTRY by bar

    in Strategy Wizard 'Condition and action' how can I determine when (current bar at close) the Strategy Action actualy 'Do' /Order management - Enter long position ?? I did try 'Define user variable' but this works as a toggle that once triped is always until reset.

    #2
    Not sure I follow with what you are trying to do. To mark the bar your EnterLong() order was submitted you would could set a variable to something the same time your order is submitted.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh
      I did use the Strategy Action to set a variable..trouble is the variable works as a toggle so "When following conditions are true", bar#5, to Enter long, on bar #6, the variable starts the value assigned in the 'define user variable' in "Do the following". However, because of the toggle action, the variable persists to bar #6,7,8,9,... until/if the variable is ever changed by another command.
      Goal: In Strategy I have constructed 9 different sets that will 'Enter long'. What I am need to do is construct set#10 to 'Exit long' on only the very bar ,#7, following an 'Enter long' execution, bar#6, in a "stop run/head fake" scenario. (This scenario is easy to identify and extremely accurate, so saves a lot of pain in the stop loss area.) The Strategy is set to only be in one position at a time so I do not want/need to know "When following conditions" support 'Enter long' ; I need to define the actual bar the Strategy actually did 'Enter long',#6, so can/will only auto 'Exit long' on bar#7, if set#10 conditions form during bar#6, the actual bar of entry. FYI I am 'calculate on bar close' on tick data so is too fast for proper manual exit

      Comment


        #4
        Condition Builder / Strategy / Current position size: add bar enumerator

        this is one thought . In the Condition Builder , In the Strategy field: Add a bar enumerator to the "Current position size". This would alow testing to locate position size changes +or- relative to a particular bar pair. A wider application would be to support all the values in the 'Strategy' field with the parameter "bar"

        Comment


          #5
          I see what you want to do now. Instead of using a variable you can use "Bars since entry". In the top Condition Builder part, expand the "Misc" category and select "Bars since entry", select >, then on the right hand side expand "Misc" again and this time select "Numeric Value", set it to however many bars after entry you want it to be at.

          Then on the bottom select "Exit Long" as your action.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            This is great !!! However in "Misc" I only have the fields: *Default input series *Numeric value . my Ninja Trader is version: 6.0.1000.9 (Live)
            Is this in the new 6.5 BETA ??

            Comment


              #7
              Indeed it is new to the Strategy Wizard in NT6.5 beta.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Thanks Josh !!
                Tell Ray Thanks !!
                Will dn ld BETTA .. YaHoo

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by futtrader, 04-21-2024, 01:50 AM
                4 responses
                41 views
                0 likes
                Last Post futtrader  
                Started by Option Whisperer, Today, 09:55 AM
                1 response
                11 views
                0 likes
                Last Post bltdavid  
                Started by port119, Today, 02:43 PM
                0 responses
                1 view
                0 likes
                Last Post port119
                by port119
                 
                Started by Philippe56140, Today, 02:35 PM
                0 responses
                3 views
                0 likes
                Last Post Philippe56140  
                Started by 00nevest, Today, 02:27 PM
                0 responses
                2 views
                0 likes
                Last Post 00nevest  
                Working...
                X