Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Bars Object

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

    Custom Bars Object

    Is it possible to create a custom bars object which prices are the result of a mathematical operation involving two different instruments? For example: NewPrice=close[0][instr1] - 10*close[0][instr2]. I tried to find a hint in the help files, but wasn't successful.
    Thanks for helping.

    #2
    Hello Loki45,

    Thank you for your post.

    Custom bar types are not supported in NinjaScript. However, you can use the @BarsTypes.cs file as a guide to build your own bar types. You will find the @BarsTypes.cs file in the following directory on your PC: (My) Documents\NinjaTrader 7\bin\Custom\Type

    Comment


      #3
      Custom Bars Object

      Thanks, Patrick
      Maybe that's something for a future update of NT. The ThinkOrSwim platform offers calculated fields, comprised of two ore more instruments, in their data series, and all indicators work on them. It's a great extension if you want to do pair trading or something like this.

      Comment


        #4
        Hello Loki45,

        Thank you for your response.

        We look to improve upon this for the next major release of NinjaTrader.

        Comment


          #5
          Originally posted by Loki45 View Post
          Thanks, Patrick
          Maybe that's something for a future update of NT. The ThinkOrSwim platform offers calculated fields, comprised of two ore more instruments, in their data series, and all indicators work on them. It's a great extension if you want to do pair trading or something like this.
          You can code such a thing. It is just not as simple as creating a composite instrument in TOS.

          In NinjaScript, you would have to calculate the OHLC values, and use a custom Plot() to draw the chart.

          In actuality, there is a "Spread" indicator, in the sharing section of this forum, that shows and uses the technique. ref: http://www.ninjatrader.com/support/f...catid=4&id=367
          Last edited by koganam; 01-28-2014, 10:15 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          649 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          576 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X