Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi TimeFrame Strategy

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

    Multi TimeFrame Strategy

    Hi,

    I'm trying to develop a multi time frame strategy. The following is the entire of the strategy. I backtested it on strategy analyzer. I left all the parameters to default. Only changed the following
    from: 12/4/2011
    To: 12/9/2011
    Session Template: Forex
    Min. Bars Required: 0

    protected override void Initialize()
    {
    CalculateOnBarClose =
    false;
    Add(
    "$EURUSD", PeriodType.Day, 1);
    Add(
    "$EURUSD", PeriodType.Tick, 1);
    AddPointAndFigure(
    "$EURUSD", PeriodType.Tick, 1, 5, 3, PointAndFigurePriceType.HighsAndLows, MarketDataType.Last);

    }

    protected override void OnBarUpdate()
    {
    if (BarsInProgress == 1)
    {

    Print(
    "Today's Date is " + ToDay(Time[0]) + " " + "Current Bar Index is " + CurrentBar);
    Print(
    "");
    }

    }
    I got the following result on the output window
    Today's Date is 20111206 Current Bar Index is 1
    Today's Date is 20111207 Current Bar Index is 2
    Today's Date is 20111208 Current Bar Index is 3
    Today's Date is 20111209 Current Bar Index is 4
    My question is that, why is the first bar [0] for 12/5//2011 isn't printed?

    #2
    30percent, this would be unfortunately an expected limitation when a daily series is added programmatically eventhough your BarsRequired is at 0 it would print for CurrentBar = 1 and higher then.

    Comment


      #3
      Thanks.

      Also, how can I get bid price referencing the tick object without using BarsInProgress?
      I don't think I could do this - GetCurrentBid[2]

      Comment


        #4
        You're welcome, that should work though - what behavior do you see? Please keep in mind this would only work for realtime / market replay, since for historical data the close price will be substituted.

        Comment

        Latest Posts

        Collapse

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