Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy building with conditions on multiple timeframes

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

    strategy building with conditions on multiple timeframes

    Hello
    I'm using strategy builder to drawing objects into my chart.

    I wish to use it also as automatic trading. but, I need to setup conditions on multiple time frames

    example,
    I use the 5 minutes chart as trigger,
    when an indicator reach "oversold" I wish to enter long, "on each tick", so at the exact moment oversold is reached, not after bar close.

    thats the trigger.
    but I wish to setup a condition on 15 minutes, to let enter the trade into 5 minutes.

    how to do that?
    cause into strategy builder I don't see any function for that.

    #2
    In Strategy Builder go to the "Additional Data" screen and then you can add additional data series in the upper panel of that screen.

    Comment


      #3
      Originally posted by KonstantinosNT View Post
      In Strategy Builder go to the "Additional Data" screen and then you can add additional data series in the upper panel of that screen.
      ok and the conditions for the "additional data series" ? where?

      Comment


        #4
        The corresponding conditions go normally inside the Sets along with the others. You distinguish each one from the other using the Bars number identification because each data series has a unique Bars identification number.

        Comment


          #5
          I found it. but no idea what you mean with "bars number"

          Comment


            #6
            Primary data series has CurrentBars[0]. Additional data series have CurrentBars[1], CurrentBars[2], etc.

            Comment


              #7
              Originally posted by KonstantinosNT View Post
              Primary data series has CurrentBars[0]. Additional data series have CurrentBars[1], CurrentBars[2], etc.
              I don't see any of these into setting

              Comment


                #8
                how to automatic exit a position? based on a particulat entry rule?
                example: entry long set8, if indicator oversold
                it will exit this particular position if indicator get overbought. but it will do just on this automatic entry signal, no others

                Comment


                  #9
                  Hello hellboy78,

                  While you can use additional data in the builder the builder will not let you execute logic on a secondary series. The trades will be sent to the primary series.

                  example,
                  I use the 5 minutes chart as trigger,
                  when an indicator reach "oversold" I wish to enter long, "on each tick", so at the exact moment oversold is reached, not after bar close.

                  thats the trigger.
                  but I wish to setup a condition on 15 minutes, to let enter the trade into 5 minutes.


                  To do what you are asking you would need to use 5 minutes as the primary series. You can add a secondary 15 minute data series to make conditions with. That would let the conditions check the 15 minute values and submit orders to the 5 minute series.

                  Using OnEachTick only works in realtime so you will see in historical that everything still happens OnBarClose. If you wanted to test this with OnEachTick you can use the playback connection.


                  To make a exit you can form another set with any conditions that you wanted for the exit to be true. Once that condition is true you would submit an exit order. To tie an exit to a specific entry you would use the entries Signal Name as the exists From Entry Signal. Your strategy otherwise won't see other positions that it did not create so it can only ever close the positions it created.

                  Comment


                    #10
                    when I setup additional data. I setup "as primary instrument". so I don't really see the difference from primary and secondary you are talking about

                    Click image for larger version

Name:	ninja1.png
Views:	1230
Size:	26.0 KB
ID:	1234582
                    Click image for larger version

Name:	ninja2.png
Views:	1200
Size:	18.0 KB
ID:	1234583

                    about "on each tick"
                    I know it works only on real time.
                    on market replay is a solution, but I should download datas for each day one by one and gonna take months. if you have a solution to download full month datas or historical, the backtest on each tick is basically impossible

                    Comment


                      #11
                      Hello hellboy78,

                      primary instrument in that menu just means its going to use the same instrument for the secondary series. If your main instrument is the ES then the secondary series you added will also be ES.

                      There is not a built in solution to download more than one day at a time, you would need to select each day that you wanted to download. Playback data is very large in comparison to historical data so there is no option more than 1 day at a time. You can record live data for playback so you don't have to download the days you will observe in the future.

                      Comment


                        #12
                        so how to setup the primary series and secondary series? cause I don't see the option

                        Comment


                          #13
                          Hello hellboy78,

                          You already added the secondary series. They are the same instrument as your primary series with different timeframes.

                          Comment


                            #14
                            could you please explain me what you said?
                            "While you can use additional data in the builder the builder will not let you execute logic on a secondary series. The trades will be sent to the primary series."

                            so, at the moment I have conditions into 2 data series,
                            5 minutes
                            and
                            15 minutes

                            which is the "primary serie" and "secondary serie" ?

                            primary serie is the chart where I attach the strategy? or primary and secondary are set in different way?

                            I'm sorry, but not every one is familiar with ninjascript and c#

                            Comment


                              #15
                              Hello hellboy78,

                              The primary series is always the series that you apply the strategy to. If you used a chart that is your primary series. You otherwise select the primary when configuring the strategy and enabling it. If we assume you used a 5 minute chart the 5 minute series is the primary.

                              In the image you added 3 additional secondary series, 60 15 and 5 minutes. For your original concern you only need to add 1 secondary series of 15 minutes so you can remove the 5 minute and 60 minute secondary series.

                              When you run your strategy all trades are placed to the primary series meaning that if you used a 5 minute series on the chart the trades are placed to that series. If you add secondary series those are just used for price conditions in your strategy. The reason this is important is that you said you wanted to place trades on the 5 minute series and the only way to do that is to make that the primary series.

                              but I wish to setup a condition on 15 minutes, to let enter the trade into 5 minutes.
                              This configuration would be a 5 minute primary series and a 15 minute secondary series. You can then add conditions that use the 15 minute data to place trades on the 5 minute primary.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Yesterday, 05:17 AM
                              0 responses
                              59 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              134 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              74 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              45 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              50 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X