Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

creating bars

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

    creating bars

    Hello,

    Lets say i have a for loop and there is 100 bars on the chart. There is no connection no live data.

    I want to simulate upcoming bars. Lets say create 10 bars.
    Is it possible to add bars and give a specific price and volume value to those bars?

    Like barIndex 101 would have a price of 1945 with a volume of 300, bar 102 = price 1946 with a volume 560, bar 103 = price 1945.5 with a volume of 1500 etc.

    I can use Bars.GetVolume and Bars.GetClose for the remaining bars.

    Ty

    #2
    Hello frankduc,

    I'm not aware of any way to create bars without some sort of data being processed.

    A bar type script doesn't update unless a tick is being processed.

    You could choose to make a historical data file and import it so that you have some historical data.


    You could choose to use the API to generate and stream real-time data.
    https://ninjatrader.com/support/foru...626#post793626
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea,

      My system make calculation using past data in the chart. At the end a variable returns the price for T0 or current bar in progress. So if the trading price is 3131 the variable for exemple could return 3131.5 telling me the next price it will be traded. I want to return the 3131.5 in the chart or in the system so my system can recalculate and give me the next price it will trade after 3131.5. Then use AddPlot to draw a line that will show me where the price is heading.
      My problem is that every time a new bar is created on the chart it interfere with the calculation.

      Comment


        #4
        Hello frankduc,

        I'm not understanding the series or collection you are using or what values are unexpected.

        However, you can save custom calculations for each bar to a custom Series<double>.

        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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