Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to check the colors of this indicator

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

    how to check the colors of this indicator

    Hi,
    I want to create the strategy, where I want to buy when the color of this indicator is Blue and sell when the color if this indicator is Red. Can somone please let me know how to check those colors in the strategy.

    Thanks in advance
    Bill
    Attached Files

    #2
    Hello Bill,

    Thank you for your note.

    Instead of looking for the bar color, try using the same logic they use that causes the bar to change colors and check for that in your strategy. This would be easier to follow along and would allow you to have one place for calculations rather than multiple places.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      not plotting

      Hi Cal,
      I am trying to plot the arrows in this strategy and it is not doing so , can you please help me fixing what I am doing wrong.

      Thanks
      Bill
      Attached Files

      Comment


        #4
        Hello Bill,

        You are assigning the Y value for the overload properties. They are working but will be plotted at the 0 line on the price axis.

        Trying using a price point such as High[0], Low[0], Open[0], or Close[0]
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Now it print ok but does not create orders

          Hi Cal,
          will be kind enough to check that code please ??

          Thanks
          Bill
          Attached Files

          Comment


            #6
            Bill,

            You are only submitting the orders if the strategy is flat.

            That is fine, however it means that we need to wait for the Initial entry's to close out from the SetTrailStop()

            Do you seen any orders in a backtest being made?
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Cal View Post
              Bill,

              You are only submitting the orders if the strategy is flat.

              That is fine, however it means that we need to wait for the Initial entry's to close out from the SetTrailStop()

              Do you seen any orders in a backtest being made?
              Nope no entries....and it shows yellow color in the strategy windows.

              Comment


                #8
                Bill,

                A yellow state for the stategy indicates that the strategy is in a historical position and is waiting to become flat before submitting live orders.

                You can use if(Historical) return; at the beginning of OnBarUpdate() so that the strategy will ignore historical data and only run off of live data.
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Cal View Post
                  Bill,

                  A yellow state for the stategy indicates that the strategy is in a historical position and is waiting to become flat before submitting live orders.

                  You can use if(Historical) return; at the beginning of OnBarUpdate() so that the strategy will ignore historical data and only run off of live data.
                  By adding this statement...it is working...thanks Cal.

                  Comment


                    #10
                    Originally posted by billsingh View Post
                    By adding this statement...it is working...thanks Cal.
                    Hi Cal,
                    Stop loss not working on Entry1 for some reason. I like have stoploss trail 1 after 10 ticks ??

                    SetTrailStop("Entry2", CalculationMode.Ticks, 10, false);

                    Comment


                      #11
                      Bill,

                      You will want to assign the SignalName to the SetStopLoss() and then you need to increase the entries per direction to 2 in order to submit multiple orders in the same direction.

                      Let me know if this resolves the entries
                      Cal H.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_Cal View Post
                        Bill,

                        You will want to assign the SignalName to the SetStopLoss() and then you need to increase the entries per direction to 2 in order to submit multiple orders in the same direction.

                        Let me know if this resolves the entries
                        Hi Cal,
                        Here is what exactly I like to do. I want to place 2 orders. Entry1 for 2 contracts. Entry2 for 1 contracts. I like to have stoploss on both for 10 ticks. Profit target on Entry1 will be 10. Entry2 will have training profil/loss. Will this be the right code for it. What if I want also to breakeven +1 after 10 ticket for Entry2 ???

                        SetStopLoss("Entry1", 10);
                        SetStopLoss("Entry2", 10);
                        SetProfitTarget("Entry1", 10);
                        SetTrailStop("Entry2", CalculationMode.Ticks, 10);

                        Thanks
                        Bill

                        Comment


                          #13
                          Bill,

                          This won't be possible with the Managed Set() orders.

                          You can only use one or the other Set() method per Signal Name and position.

                          If want to accomplish something like this then you will need to create the Exit() orders and track the logic yourself for this in strategy.
                          Cal H.NinjaTrader Customer Service

                          Comment


                            #14
                            Originally posted by NinjaTrader_Cal View Post
                            Bill,

                            This won't be possible with the Managed Set() orders.

                            You can only use one or the other Set() method per Signal Name and position.

                            If want to accomplish something like this then you will need to create the Exit() orders and track the logic yourself for this in strategy.
                            Do you have any template I can use for this. So I can add my entry logic in there.

                            Comment


                              #15
                              Originally posted by billsingh View Post
                              Do you have any template I can use for this. So I can add my entry logic in there.
                              Or can you create one template for me please.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              85 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              47 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              29 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              32 views
                              0 likes
                              Last Post TheRealMorford  
                              Started by Mindset, 02-28-2026, 06:16 AM
                              0 responses
                              67 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Working...
                              X