Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Tab viewing in Strategy Analyzer

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

    Chart Tab viewing in Strategy Analyzer

    Have the primary Index on 30min but the exits are based on 1 & 10min bars. Is there anyway to have the smaller bars show up and still have the entries and exits printed? Or any suggestions for a work around. It's really hard to evaluate details when all you can see is the large range bars.

    #2
    Hello zachj,

    The Chart tab of the Strategy Analyzer will only display the Primary Series that your strategy is set to. If you would like to view it on a smaller time frame you may want to set your Primary Series on the smaller time frame and ad the 30 Minute series for your calculations.
    JCNinjaTrader Customer Service

    Comment


      #3
      Ok thanks. Just one other question, I can start a new thread if you want. But is there anyway to adjust/control the index the profit target is based on in the initialize section? I can see the profit target is hit say for instance at 10:08 but given the primary is 30min it doesn't show it exiting until 10:30. It's always on a 30min basis.

      Comment


        #4
        Hello zachj,

        This question is similar to your first. So NinjaTrader is going to display your Chart including the trades based on your Primary Series that you have set your strategy to which is why you see the order one the 30 Minute bar. If you set your Primary Series to something like 1 Minute then you will see the order placed on the 10:08 bar because the order will be displayed on the 1 Minute series.

        Let us know if we can be of any further assistance.
        JCNinjaTrader Customer Service

        Comment


          #5
          I don't think I made the question clear, when I was talking about seeing the exits I meant in the trades tab. The exit times are never when the actual profit target was hit but instead are always showing in the trades tab as being on the half hour exactly. I believe this is likely giving me false profits. So the question is, is there a way to set which index the profit target exits on? I would want to set it to be based on 1min which is Index 1 for me. Or does it just always exit on the primary and I have to readjust the way my indexes are setup?

          Comment


            #6
            Hello zachj,

            Yes, this would be possible to do but you would have to define the exit orders manually by using the Exit method instead of the SetProfitTarget() or SetStopLoss(). Using the Exit methods you may use "Advanced Order Handling" to be able to define a Series/Index to place your order to.

            For example on the ExitLongLimit:

            ExitLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName, string fromEntrySignal)

            Code:
            ExitLongLimit(1, true, 1, High[1][0], "Exit Order");
            JCNinjaTrader Customer Service

            Comment


              #7
              Sounds like I'm better off using the smallest bars in the script as the primary index. If I have a 30min primary and a 1min for the index bars in enterlong, I don't think the 1min bar is being recognized within that large range. It's showing profits that are not real and has exit times before entries etc. But using a 1min as primary is a lot of data on the charts. Years later and I still continue to have issues with bar sequencing in NT. Mess.

              Comment


                #8
                Hello zachj,

                Are you adding a check to make sure that your strategy is only entering orders on your Primary Series or Index 0?

                We have a sample strategy that demonstrates this that you can download and test out at the following thread.

                You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


                You can test this out on a 5 Minute or a 30 Minute time frame.
                JCNinjaTrader Customer Service

                Comment


                  #9
                  And this how I've always done it. In this sample strategy the primary is 5min. If my primary is 30min instead, how would you go about setting up your profit target, would you put it in initialize as usual?

                  If so you look in the trades tab and the profittarget exits all exit on the half hour instead when it actually hits the target. So for example profittarget is reached at say 3:07 but trades tab shows exit at 3:30.

                  Comment


                    #10
                    Hello zachj,

                    Using the SetProfitTarget(), SetStopLoss(), SetTrailStop() they will all be based on your Primary Series/Index. If you would like to define what Series/Index you want your profit target and stop loss orders to be on you will have to use an Exit method to place your profit target and stop loss orders manually and use the "Advanced Order Handling" for these methods. See post #6 for more information and an example.

                    If you do not want to use the "Advanced Order Handling" for your Exit methods then you may want use the smallest time frame for your Primary Series/Index.
                    JCNinjaTrader Customer Service

                    Comment


                      #11
                      What is the difference between setting up as

                      if (BarsInProgress = = 3)
                      {
                      if(Open[0] > Close[0])
                      {
                      EnterLong(0, 1, "")
                      }
                      }

                      and just doing it like this?

                      if(Opens[3][0] > Closes[3][0])
                      {
                      EnterLong(0, 1, "")
                      }

                      Why do they have different results, is one correct and one wrong?

                      Comment


                        #12
                        Hello zachj,

                        The difference is when each one of them is called. The following is only going to be called when your 3rd index is running.

                        Originally posted by zachj View Post
                        if (BarsInProgress = = 3)
                        {
                        if(Open[0] > Close[0])
                        {
                        EnterLong(0, 1, "")
                        }
                        }
                        This is due to the BarsInProgress checking.


                        The next statement is going to be called on every call to OnBarUpdate() meaning that since you have multiple series it is going to be called each time. The reason why this is wrong is because if you have a smaller series it is going to be called multiple times and be true when you do not want it to be.

                        Originally posted by zachj View Post
                        if(Opens[3][0] > Closes[3][0])
                        {
                        EnterLong(0, 1, "")
                        }
                        Here is a link to our Help Guide with an in-depth example of this that you may view.
                        JCNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by love2code2trade, Yesterday, 01:45 PM
                        4 responses
                        28 views
                        0 likes
                        Last Post love2code2trade  
                        Started by funk10101, Today, 09:43 PM
                        0 responses
                        7 views
                        0 likes
                        Last Post funk10101  
                        Started by pkefal, 04-11-2024, 07:39 AM
                        11 responses
                        37 views
                        0 likes
                        Last Post jeronymite  
                        Started by bill2023, Yesterday, 08:51 AM
                        8 responses
                        45 views
                        0 likes
                        Last Post bill2023  
                        Started by yertle, Today, 08:38 AM
                        6 responses
                        26 views
                        0 likes
                        Last Post ryjoga
                        by ryjoga
                         
                        Working...
                        X