Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding Data series To a strategy

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

    Adding Data series To a strategy

    Click image for larger version

Name:	image.png
Views:	415
Size:	721.7 KB
ID:	1260050

    ​How do I add this data series as to a strategy?

    #2
    Hello kal1212,

    To use custom bars types you need to manually code the script and use AddDataSeries. The following comments from the AddDataSeries page are relevant:
    2. You can add a custom BarsType which is installed on your system by casting the registered enum value for that BarsPeriodType. For example: AddDataSeries((BarsPeriodType)14, 10);

    3. You can specify optional BarsPeriod values (such as Value2) of a custom BarsType in the BarsPeriod object initializer. For example: AddDataSeries(new BarsPeriod() { BarsPeriodType = (BarsPeriodType)14, Value = 10, Value2 = 20 });


    You can use the following tool to output ids for imported bars types:
    This is just a simple script which prints the BarsTypes and their BarsPeriodType ID as an integer. This is to aid in finding BarsPeriodType ID’s for the use with AddDataSeries syntax. For more apps from this user, check out the Trendline Detection tool!


    For the heiken ashi it would look like this:

    AddDataSeries(new BarsPeriod { BarsPeriodType = (BarsPeriodType) 42069});

    Comment


      #3
      Thank You. So after I add the tool to a chart where do I find the ids that it outputs?

      Comment


        #4
        Nvm. Found it.

        Comment


          #5
          Hello kal1212,

          You would need to use the NinjaScript output window, you can access that from the control center New menu.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          88 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          134 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          68 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          119 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          69 views
          0 likes
          Last Post PaulMohn  
          Working...
          X