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

Day and Time

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

    Day and Time

    Hi,
    I'm not sure if it is a bug in the system or I misinterpreted it. I have the following point and figure strategy and I backtested it on strategy analyzer. I ran them for 3 different dates: a) Dec 9, b) Dec 8, c) Dec 5. The only parameters I changed were the date obviously, and set Min-Bars-Required to 0. And the following are the results for the 3 different dates.

    a) Test Date: 12/9/12 - 12/9/12
    Day 1st Bar: 20111208
    Time 1st Bar: 182001
    Day Last Bar: 20111209
    Time Last Bar: 165535

    b) Test Date: 12/8/12 - 12/8/12
    Day 1st Bar: 20111207
    Time 1st Bar: 185724
    Day Last Bar: 20111209
    Time Last Bar: 165535

    c) Test Date: 12/5/12 - 12/5/12
    Day 1st Bar: 20111205
    Time 1st Bar: 20022
    Day Last Bar: 20111206
    Time Last Bar: 154836

    FX session opens from 1 day 5pm to next day 5pm. So for the test result for a) Dec 9 seems right.

    However for b) Dec 8 and c) Dec 5 the results don't seem right.

    For b) Dec 8 - it seems to process data of 2 trading sessions: Dec 7 - Dec 9.
    For c) Dec 5 - since it is a Monday, FX market opens on Sunday. So the 1st bar's day should really starts from Dec 4 and last bar ends Dec 5. Instead, the system processed data from the 5th to the 6th.

    Please advise.

    Code:
    protected override void Initialize()
    {
    AddPointAndFigure("$EURUSD", PeriodType.Tick, 1, 5, 3, PointAndFigurePriceType.HighsAndLows, MarketDataType.Last);

    }
    protected override void OnBarUpdate()
    {
    if (BarsInProgress == 1)
    {
    Print(High[0]);
    Print(Low[0]);
    Print("The Day is:");
    Print(ToDay(Time[0]));
    Print("The Time is:");
    Print(ToTime(Time[0]));
    Print("");

    }

    }

    #2
    30percent,

    What session template are you using?

    The results don't look abnormal to me. I would suggest checking when the trades were placed themselves.
    Last edited by NinjaTrader_AdamP; 12-21-2011, 08:35 AM.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Previously, I left the template session to it default setting. However, after visiting your post, I reran it again, using FOREX template session. And I got the same results.

      On 2 separate backtests:
      a) I set test dates 12/5-12/5 to test for 12/5 trading session. In FX market if the spot is trading for the 5th, which is a Monday - session should begin Sun 5pm EST - Mon 5pm est. But in the test, it seems to process data from 12/5 to 12/6.

      b) I set test dates 12/8/-12/8 to test for 12/8 trading session. Which should begin from 12/7 5pm EST to 12/8 5pm EST. However, the test seems to run from 12/7-12/9 - 2 trading sessions!

      Comment


        #4
        Hello,

        'Use Instrument Settings' for any forex symbols would be the 'Forex' session template, so the same results would be expected. If you would like to see if the session template is contributing, you can try creating your own custom session template, or using a pre-built one to see if this changes the results you are seeing.

        What is the base input you are using for the tests? That is, what chart type/interval are you using? Is this also a point and figure chart? How does the base period differ from the added point and figure method?

        Also are you trying to receive the High/Low from the base input, or from the Added point and figure? If you are using High[0] it will return the base input - if you're looking for the values from your Added point and figure series, you would want to use Highs[1][0] (- http://www.ninjatrader.com/support/h...html?highs.htm)
        MatthewNinjaTrader Product Management

        Comment


          #5
          Hi,

          please refer to the code on my first post. That was the entirety of my strategy.

          I have only changed the parameters such as dates, min required bars to 0, and session template to the built-in NT's FOREX template on the backtest menupage.

          I set the (BarsInProgress == 1) to call on the added point-and-figure object.

          Comment


            #6
            30percent,

            When you run your backtest, what are time frame are you running it on? I understand you have point and figure added as a second data series, however its helpful to know the other settings.

            For c) Dec 5 - since it is a Monday, FX market opens on Sunday. So the 1st bar's day should really starts from Dec 4 and last bar ends Dec 5. Instead, the system processed data from the 5th to the 6th.
            Since you specified to start on the 5th it won't necessarily look back to the 4th. If you want to include the open on Sunday the 4th you would need to include it.

            Point and figure charts are time-independent so bars may be straddling trading sessions since it takes a certain number of ticks to produce each column. Time independent charts are sensitive to where they are initialized, and may look different depending on this.
            Adam P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by r68cervera, Today, 05:29 AM
            0 responses
            2 views
            0 likes
            Last Post r68cervera  
            Started by geddyisodin, Today, 05:20 AM
            0 responses
            3 views
            0 likes
            Last Post geddyisodin  
            Started by JonesJoker, 04-22-2024, 12:23 PM
            6 responses
            33 views
            0 likes
            Last Post JonesJoker  
            Started by GussJ, 03-04-2020, 03:11 PM
            12 responses
            3,239 views
            0 likes
            Last Post Leafcutter  
            Started by AveryFlynn, Today, 04:57 AM
            0 responses
            6 views
            0 likes
            Last Post AveryFlynn  
            Working...
            X