Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Previous bar update from server

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

    Previous bar update from server

    I've been developing a strategy where all of my analysis has been on historical data. I'm now finally testing with real time data. Problem is, I don't have access to GIG speed internet. Mine is only 40 mbps. I'm finding that when I'm loading data in real time, I'm missing a lot and the data is not very accurate. But in truth my strategy makes all of it's decisions based on the previous bar (bars ago = 1). So I'm wondering if it is possible to pull the OHLC of the previous bar from the server when I've hit IsFirstTickOfBar so that I know that it is truly accurate?

    #2
    Hello dweems,

    Thanks for your post.

    A barsAgo value of 1 could be passed into Open[barsAgo], High[barsAgo], Low[barsAgo], and Close[barsAgo] to get the previous bar's open, high, low, or close value.

    These values could be accessed within a condition that checks if (IsFirstTickOfBar) if you wanted.

    For example:

    if (IsFirstTickOfBar)
    {
    Print("Previous bar Open: " + Open[1]);

    Print("Previous bar High: " + High[1]);

    Print("Previous bar Low: " + Low[1]);

    Print("Previous bar Close: " + Close[1]);
    }



    See the help guide documentation below for more information.

    IsFirstTickOfBar: https://ninjatrader.com/support/help...firsttickofbar
    PriceSeries (Open, High, Low, Close): https://ninjatrader.com/support/help...riceseries.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      I already use the Open/High/Low/Close arrays as well as Opens/Highs/Lows/Closes in order to access Ask values for Forex data. Question is, does that data come from the real time data that is received at my computer and is displayed on my charts or will it retrieve that data from the server when I read those arrays after I find IsFirstTickOfBar​ == true? If those arrays are based on real time data, they will only have partial data defining them based on what real time data makes it on my slow internet. If these arrays are refreshed from the server independent of the real time data populating my chart, that will be great. But I'm not convinced that is happening based on what I'm seeing on my chart. How and when are these arrays populated?

      Comment


        #4
        Hello dweems,

        Thanks for your notes.

        Open[1], High[1], Low[1], and Close[1] would get the Open, High, Low, and Close values from the previous bar on the chart.

        To get the Open, High, Low, Close information you would need to use Open[1], High[1], Low[1], and Close[1].

        Or your could use GetOpen(), GetHigh(), GetLow(), GetClose(), which would retrieve the prices from a specified bar index.

        Those would be the only methods or functions available for accessing those price values.

        GetOpen(): https://ninjatrader.com/support/help...t8/getopen.htm
        GetHigh(): https://ninjatrader.com/support/help...t8/gethigh.htm
        GetLow(): https://ninjatrader.com/support/help...nt8/getlow.htm
        GetClose(): https://ninjatrader.com/support/help...8/getclose.htm
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        65 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        139 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 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