Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Timeframe issues

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

    Multi Timeframe issues

    The following are snippets from the output window and the relevent sections of code
    Code:
    08/25/2010 2:39:22 PM Entered internal PlaceOrder() method at 08/25/2010 2:39:22 PM: Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='ShortatVPC' FromEntrySignal=''
     
    Short
     
    InPostion = False
     
    Execution='NT-00004' Instrument='ES 09-10' Account='Backtest' Name='ShortatVPC' Exchange=Default Price=1052.25 Quantity=1 Market position=Short Commission=2.2 Order='NT-00006' Time='08/25/2010 2:40:00 PM'
    This is what I am having problems with
    timeframe 0 = range bars = 2 ticks
    timeframe 1 = 5 min bars

    All this happens in BarsInProgress == 0 with traceorders = true
    private IOrder entryOrder = null;

    if (!InPosition)
    {
    entryOrder = EnterShort(
    0, 1, "ShortatVPC");
    Print(
    "Short");
    Print("InPostion = " + InPosition);
    }

    privatebool InPosition { get { return Position.MarketPosition != MarketPosition.Flat; } }

    protectedoverridevoid OnExecution(IExecution execution)
    {
    if (entryOrder != null && entryOrder == execution.Order)
    Print(execution.ToString());
    }

    Notice the timestamps on the messages.
    So what am I missing...why does it take 38 sec? and why doesn't OnExecution fire before InPosition evaluates? And why does InPosition evaluate to false anyways? I am stumped.

    #2
    Ok I figured out the timestamp issues....It seems that the 2 range bar closed at exactly '08/25/2010 2:40:00 PM'

    But my othere ?'s remain
    why doesn't OnExecution fire before InPosition evaluates? And why does InPosition evaluate to false anyways?

    Comment


      #3
      I figured it all out now. The issue was where I was calling everthing imy code...I switched the order of some tings and everything worked as expected.

      You may close this issue.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      647 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X