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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        164 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        319 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        246 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        350 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X