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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      87 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      47 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      66 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      69 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      59 views
      0 likes
      Last Post CarlTrading  
      Working...
      X