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

Multiple signal execution

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

    Multiple signal execution

    I'm using a strategy with calculateonbarclose=true. When the strategy gets a signal , it opens a position. Does anyone know if there is a parameter I can toggle so that if another signal occurs while an open position exists, it will open a second position for the new signal?

    Thanks,

    Safetrading

    #2
    safetrading,

    Make sure the second signal triggers. When you run the strategy increase the EntriesPerDirection setting and then it will take that second trade as well as the first.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Great, thanks a lot Josh. Have a nice day.

      Originally posted by NinjaTrader_Josh View Post
      safetrading,

      Make sure the second signal triggers. When you run the strategy increase the EntriesPerDirection setting and then it will take that second trade as well as the first.

      Comment


        #4
        Multiple positions continued

        Hi Josh;

        I looked at my strategy after receiving your message and noted that I already had the "entries per direction" set to 2. While this was set this way yesterday, my strategy skipped 3 signals. All were when I already had an open position. What else can I try?

        Thanks,

        Safetrading

        Originally posted by safetrading View Post
        Great, thanks a lot Josh. Have a nice day.

        Comment


          #5
          safetrading,

          Please use TraceOrders = true in your strategy then to track down the reason the orders are rejected. You should also use Print() to see if your signals were indeed evaluated to true.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            I added the traceorder & print as you suggested and now I have a new problem. I edited my entry condition to make it simple, it asks for an indicator to be below a bollinger band for a long limit entry and to be above a bollinger band for a short entry.

            Now I have entries initiated by the strategy when the entry criteria doesn't exist. When I looked at the Output window to see why, I noticed the output data does not agree with the displayed data of my indicator, when both are labeled the same.

            My indicator on my chart displyed the following;
            Indicator: -5005.94
            Lower Band: - 5958.57

            Output Window Indicator: -4943.07
            Output Window Lower Band: - 4347.26

            The strategy say to open a long position when the indicator is below the lower band, which according the the indicator on my chart didn't happen, but the output window says it did!

            I copied and pasted the code for the output window FROM the indicator, so there is no transposition error there, why would the two outputs, (graphic indicator on the chart & output window) not agree, and how can I resolve this, as the way it is now I can not debug my strategy.


            Originally posted by NinjaTrader_Josh View Post
            safetrading,

            Please use TraceOrders = true in your strategy then to track down the reason the orders are rejected. You should also use Print() to see if your signals were indeed evaluated to true.

            Comment


              #7
              attachemetn

              I attached a screen shot so you can see the discrepancy between the output window and the indicator. The last three entries in the Output window cossespond to the indicator to the right of the window. You can see that the indicator is the same in both the output window and on the chart, but both the upper and lower band numbers don't match.
              Attached Files

              Comment


                #8
                You need to compare apples to apples. To start things off just remove all of your logic and just add the indicator and print the value of the indicator along with timestamp. Then you can match them up with what you see on the chart. Right now you are just simply printing values without knowing when these values were triggered.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  continued

                  Hi Josh;

                  I did as you suggested, I removed all trading logic and just put in the time stamp and indicator values. Doing this I got the following discrepancy;

                  Chart values, top to bottom;
                  2734.51
                  -842.64
                  -3689.07

                  Output Window values in the same order;
                  402.37
                  -576.25
                  -390.35

                  I attached a screen shot showing the discrepancy. What can I do to get the output window and chart in sync?

                  Originally posted by NinjaTrader_Josh View Post
                  You need to compare apples to apples. To start things off just remove all of your logic and just add the indicator and print the value of the indicator along with timestamp. Then you can match them up with what you see on the chart. Right now you are just simply printing values without knowing when these values were triggered.
                  Attached Files

                  Comment


                    #10
                    Please ensure your indicator does not have any CalculateOnBarClose settings.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      continued

                      Hi Josh;

                      Its been a few hours now and I haven't changed anything at all, but now the output window agrees with the indicator in the chart. For the last few hours (I only checked every 10 minutes or so) it did not. So while it was not working, it now is.

                      In the future is these two components get out of sync, is there anything I can do to get them back together again?

                      Thanks,

                      Comment


                        #12
                        Would not be able to suggest you anything unless I know of the reason it happened to begin with.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          continued

                          Hi Josh;

                          I do not have any calculateonbarclose settings within the indicator, but in the parameters window of the chart, I had selected Calculate on bar close = false for this indicator. Would that cause this issue?

                          Comment


                            #14
                            You should not touch anything in terms of CalculateOnBarClose for the indicator as called from the strategy.
                            Josh P.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Carolscogginsi, Yesterday, 10:45 PM
                            0 responses
                            6 views
                            0 likes
                            Last Post Carolscogginsi  
                            Started by RaddiFX, Yesterday, 10:15 AM
                            2 responses
                            15 views
                            0 likes
                            Last Post RaddiFX
                            by RaddiFX
                             
                            Started by patrickmlee007, Yesterday, 09:33 AM
                            2 responses
                            18 views
                            0 likes
                            Last Post patrickmlee007  
                            Started by magnatauren, 08-15-2020, 02:12 PM
                            5 responses
                            208 views
                            0 likes
                            Last Post RaddiFX
                            by RaddiFX
                             
                            Started by rene69851, 05-02-2024, 03:25 PM
                            1 response
                            23 views
                            0 likes
                            Last Post rene69851  
                            Working...
                            X