Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Previous day high low open close price in C#

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

    Previous day high low open close price in C#

    Hi Team
    I do not see the exact previous open, close, high and low values of previous Day candle.

    Sometime I get values of high, open, low, close values are not at all accurate.

    so basically I am unable to get the exact information of all the values in C# strategy.

    example, used below code for getting details of Axis Bank for 21/01/2021(on 22/01/2021 day using below code) values appeared as Low:673.6 High:690.8 Open:676.45 Close:689.5)
    double previousDayClose = PriorDayOHLC().PriorClose[0];
    double previousDayHigh = PriorDayOHLC().PriorHigh[0];
    double previousDayOpen = PriorDayOHLC().PriorOpen[0];
    double previousDayLow = PriorDayOHLC().PriorLow[0];

    But actual Low:669.75 High:695 Open:680.75 & Close:675.85


    I have also attached the trading platform candles which is not similar if you observe, so why do I see such difference?
    Attached Files

    #2
    Hello rajeshks1988,

    Thanks for your post.

    The PriorDayOHLC() indicator can only be used on Intraday data. What bars type and bar size are you using with the indicator?

    I would check to see if the trading hours are correct for the instrument as the trading hours control/limit what data is available.

    You might also test with the trading hours of "Default 24x7".



    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Yes I am using trading hours of "Default 24x7" but I am located in europe and accessing Indian share market(NSE).
      Issue here is the candle which are appearing is not the same size of actual candles and I was shocked to see 2 candles generated on Day Chart for today(25thJan2021) as per picture AxisCandlesNinjaTrader.png (One canlde generated on Yesterday Sunday(24/01/2021) and one more candle generated today, can you please check SuprosedCandledWhichisGeneratedWithSundayDate.png picture)

      I am using 5 mins bars chart but added 1440 mins data series to get the previous day high, low, open and close price.

      Also when I see the day candle size its not the same as actual candle as ninjatrader is showing different size of day candle for example check the attachments.

      Could you please assist me on skype at [email protected] is my skype ID or can you please schedule a call.

      Regards,
      Rajesh KS.
      Attached Files
      Last edited by rajeshks1988; 01-25-2021, 01:09 PM.

      Comment


        #4
        Hello rajeshks1988,

        Thanks for your reply.

        You can check the candle values on the chart using the data box or the mini data box, here is a link to the help guide: https://ninjatrader.com/support/help.../?data_box.htm

        You would not need to create a 1440 bar to get the day OHLC from the indicator PriorDayOHLC as it will work with the 5 minute data.

        So the data you are viewing in Ninjatrader is not from a live data feed but imported? If that is the case then I would suggest checking your import data for correct values before importing.

        Another consideration that you may want to try setting your platform time zone to be the same as the instrument source. Tools>Options>general Time zone: https://ninjatrader.com/support/help...eralProperties (always restart after changing this).



        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hi NinjaTrader_PaulH,
          Its live data but in order to get rid of candles issues I tried impiort data from other data sources like databull.in data puller.
          During the live market I get the data from DataBull which is external Source, So I get live data on Ninjatrader chart.

          Another consideration that you may want to try setting your platform time zone to be the same as the instrument source. Tools>Options>general Time zone: https://ninjatrader.com/support/help...eralProperties (always restart after changing this).:- I am already using time zone as +5.30(Chennai, Kolkata, Mumbai, Delhi)
          Still I see double candle for the day.
          Why is it happening so?

          Comment


            #6
            Hello rajeshks1988,

            Thanks for your reply and clarifications.

            Please use the trading hours of "Nse" template.

            You can get double candles if the data hours and template hours do not align.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              HI,
              I did the settings as NSE but still I do not see any difference.

              What else should I try to do to get appropriate candles?
              Attached Files

              Comment


                #8
                Hello rajeshks1988,

                Thanks for your reply.

                At this point to get you back to ground zero, we recommend resetting the NinjaTrader time zone back to the PC time zone which I believe you have set for Europe. Next restart NinjaTrader, connect to your live and historical data feed, open your chart with NSE as the trading hours selection. On your chart, right mouse click and select "Reload all historical data".

                If that does not resolve the issue, It is possible, that you may need to disconnect from the data feed and delete all of your historical data (you can do this via Tools>Historical data) and then restart and reconnect and once more load your chart.

                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Ok fine, it working now.
                  At last now I am receiving day before yesterday trading open, high, low and close values but I am expecting yesterday's open, high, low and close price when I use PriorDayOHLC() indicator.
                  like for
                  close=PriorDayOHLC().PriorClose[0];
                  open = PriorDayOHLC().PriorOpen[0];
                  high= PriorDayOHLC().PriorHigh[0];
                  low= PriorDayOHLC().PriorLow[0];

                  When I use CurrentDayOHL() indicator I get open, high and low prices of yesterday.
                  Why is it happening so?

                  I imported data yesterday from external source and currently ninjatrader is getting live data also from the same location which displays live candles for selected period.

                  But from indicators I am not getting the expected values as I explained earlier.

                  My system time is set to EU(amaterdam as I reside in netherlands)
                  Ninjatrader is having setting of India time for trading NSE with Default 24*7
                  Imported data in ninjatrader yesterday using Amsterdam(Netehrlands) time settings.

                  Can you let me know if I am doing anything wrong here.
                  Last edited by rajeshks1988; 01-29-2021, 12:15 AM.

                  Comment


                    #10
                    Hello rajeshks1988,

                    Thanks for your reply.

                    In post # 8 I asked you to, "At this point to get you back to ground zero, we recommend resetting the NinjaTrader time zone back to the PC time zone which I believe you have set for Europe. Next restart NinjaTrader, connect to your live and historical data feed, open your chart with NSE as the trading hours selection. On your chart, right mouse click and select "Reload all historical data".

                    In post #9 you stated, "Ok fine, it working now."

                    Then you are reporting, "Ninjatrader is having setting of India time for trading NSE with Default 24*7"

                    once again, we recommend resetting the NinjaTrader time zone back to the PC time zone which I believe you have set for Europe. Next restart NinjaTrader, connect to your live and historical data feed, open your chart with NSE as the trading hours selection. On your chart, right mouse click and select "Reload all historical data".
                    Paul H.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by guillembm, Today, 11:25 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post guillembm  
                    Started by Mongo, Today, 11:05 AM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by Tim-c, Today, 10:58 AM
                    1 response
                    2 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by traderqz, Yesterday, 09:06 AM
                    4 responses
                    27 views
                    0 likes
                    Last Post traderqz  
                    Started by traderqz, Today, 12:06 AM
                    4 responses
                    7 views
                    0 likes
                    Last Post traderqz  
                    Working...
                    X