Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy building with conditions on multiple timeframes

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

    #16
    now its clear. thanks
    I also noted that trailing stop doesn't work into strategy during backtest

    Comment


      #17
      Hello hellboy78,

      Trailing does work in a backtest however its modified based on the OnBarUpdate events. because OnBarClose processing is always used in a backtest the trailing would only be able to be moved once per bar. To test this concept fully you would need to use the Playback connection so you can see the OnEachTick trailing happening.

      It is possible to update a Trailing stop tick by tick in a backtest but that would require manually coding the script. A 1 tick secondary series can be used and then the target can be resubmitted on that 1 tick series, that would allow it to be updated intrabar similar to realtime.

      Comment


        #18
        I'm trying to setup the SL and TP, and traling into strategy builder, than add the strategy into live chart.
        but SL and TP are not the ticks I setup.
        why?


        Click image for larger version

Name:	ninja3.png
Views:	196
Size:	26.8 KB
ID:	1234742
        Click image for larger version

Name:	ninja4.png
Views:	186
Size:	23.4 KB
ID:	1234743

        Comment


          #19
          Hello hellboy78,

          You can remove the Variables you added, you are using the User Inputs for your targets. You need to specify the defaults in the user input section and not the variables section.

          Also keep in mind The SetTrailStop cannot be used with the SetStopLoss, you can use one or the other.

          Comment


            #20
            ok, but with the setting you see into attachments, into my chart I have in reality , 20 ticks SL and 5 ticks TP
            how is possible?

            Comment


              #21
              Hello hellboy78,

              Did you make sure the user inputs have the correct values while applying it? What you pictured are the defaults in the script but could be something else if you changed it while applying it. If you previously saved a default template those values would be used instead. I otherwise wouldn't be able to tell what may have happened based on those screenshots.

              Comment


                #22
                nha. I didn't make any changes.
                default is already set

                Comment


                  #23
                  Hello hellboy78,

                  From the images I wouldn't be able to tell what may be happening aside from the trail stop should not be working. I would suggest trying to remove the trail stop so you just have a stop and target and then recompile and re test. When are re testing make sure that you don't just F5 reload or disable/re enable the strategy, you need to remove it and re apply it to see changes with user inputs or the stops and targets page.

                  Comment


                    #24
                    it works. thanks. I don't really think the auto trade is the way.
                    maybe to draw some diamonds and arrows, yes.

                    how to, for a particular condition, draw a diamond, for example, but into a separated panel

                    for example

                    diamonds of 60min condition, at the bottom, diamonds of 15 min condition on second line, 5min diamonds on first line at the top

                    Comment


                      #25
                      Hello hellboy78,

                      The drawing objects by default are in the price panel. If you run the strategy in a sub panel the objects could be drawn then by using DrawOnPricePanel = false.

                      https://ninjatrader.com/support/help...sub=pricepanel

                      it sounds like you may need to make an indicator for the use case you described, the indicator could be applied to a sub panel to mark that panel while the strategy is still in the primary panel.

                      Comment


                        #26
                        ok, but there is not a way to make an indicator with a builder

                        Comment


                          #27
                          Hello hellboy78,

                          Right you would need to make that in the NinjaScript editor. The builder can add indicators in conditions and then use the Plot on chart option to show it. In this use case if you just wanted an indicator for display purposes you can make a new set and a condition to use the indictor in some way even if that condition does not make sense. As long as you call the indicator and choose plot on chart you can have the indicator added and use its own logic.

                          You can generate the conditions you want in the builder and click View Code then copy that generated code for the conditions/drawing to the indictor if you dont want to manually code it.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by NullPointStrategies, 03-13-2026, 05:17 AM
                          0 responses
                          93 views
                          0 likes
                          Last Post NullPointStrategies  
                          Started by argusthome, 03-08-2026, 10:06 AM
                          0 responses
                          152 views
                          0 likes
                          Last Post argusthome  
                          Started by NabilKhattabi, 03-06-2026, 11:18 AM
                          0 responses
                          80 views
                          0 likes
                          Last Post NabilKhattabi  
                          Started by Deep42, 03-06-2026, 12:28 AM
                          0 responses
                          53 views
                          0 likes
                          Last Post Deep42
                          by Deep42
                           
                          Started by TheRealMorford, 03-05-2026, 06:15 PM
                          0 responses
                          65 views
                          0 likes
                          Last Post TheRealMorford  
                          Working...
                          X