Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing the Price Data in Multi-Bars

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

    Accessing the Price Data in Multi-Bars

    Hi,

    I have multi-instrument strategy - currencies with M15 time frame each. I have three IOrder variables in order to open not more than 3 positions at the same time.

    For strategy logic I do not use BarsInProgress but I use loop and access price data with Highs[x][0], Closes[x][0], etc.

    I have encountered the following problem:
    I place Stop Orders using Highs[x][0] or Lows[x][0] but I see clearly during tests that sometimes it is [x][1].

    Is this expected in any situations? Please support.

    #2
    Hello kucharek,

    Thank you for your post.

    In the case you are running the strategy in the Strategy Analyzer for your tests it would be expected that the entries are done are the close of the bar, this is also possible when running your strategy in real-time or Market Replay with CalculateOnBarClose set to True.

    However, from your description of this matter it seems that it is not that all the orders that are taken one bar back but some of the orders are on the current bar and others are one bar back. Is this correct? If so, can you provide a screenshot of this occurring on your chart (real-time, Market Replay, or the Chart tab of the Strategy Analyzer)?

    I look forward to assisting you further.

    Comment


      #3
      Hello,

      I am testing in real time.

      In the meantime I have checked one of the instrument where the problem was on 30 seconds time frame and indicated that there was 11:49:45 bar and 12:00:15 bar but there was no 12:00:00 bar. I have checked it during live data feed. After reloading historical data bar occurred.

      If I am right this is the issue here, so I have already switched to BarsInProgress.

      Comment


        #4
        Hello kucharek,

        Thank you for your response.

        I am glad you were able to determine a possible cause for the matter of concern.

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by arvidvanstaey, Today, 02:19 PM
        2 responses
        6 views
        0 likes
        Last Post arvidvanstaey  
        Started by jordanq2, Today, 03:10 PM
        0 responses
        2 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        46 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by mmckinnm, Today, 01:34 PM
        3 responses
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X