• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Time Bars & Limit Orders

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

    Multiple Time Bars & Limit Orders

    Hi

    I am having trouble coding Limit orders with Multiple Time Bars. The orders are generated in the primary bars and immediately cancelled. The TraceOrders log reads as follows:

    7/14/2008 9:39:42 AM Entered internal PlaceOrder() method at 7/14/2008 9:39:42 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=25.64 StopPrice=0 SignalName='EST' FromEntrySignal=''

    7/14/2008 9:39:42 AM Entered internal PlaceOrder() method at 7/14/2008 9:39:42 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='XLG' FromEntrySignal='ELG'
    7/14/2008 9:39:42 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='XLG' FromEntrySignal='ELG' Reason='This was an exit order but no position exists to exit'

    7/14/2008 9:39:42 AM Cancelled expired order: BarsInProgress=1: Order='cf418d4694aa4e4eb4fab02c521d9979/Replay101' Name='EST' State=Working Instrument='MSFT' Action=SellShort Limit price=25.64 Stop price=0 Quantity=100 Strategy='ActVolSlpEMAMUSymbtestSLPBYSELL1T' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='cf418d4694aa4e4eb4fab02c521d9979' Gtd='12/1/2099 12:00:00 AM'

    BTW I am using Market Replay to test.

    For some reason when using market orders I do get fills, but Limit orders do not seem to work.

    Would be grateful for any assistance. I have read the documentation on Multiple Bar Strategies but cannot figure out the problem.

    Thanks

    NIKI

    #2
    Here is what I suggest:
    - start with a simple as possible strategy (like the SampleMACrossOver strategy) on replay to see how strategies work on replay. Then add complexity step by step
    - please be aware that the sim account will be cleared out as soon as you move the slider on the replay control panel. This will remove any order/position etc.
    DierkNinjaTrader Customer Service

    Comment


      #3
      Multiple Time Bars & Limit Orders

      Dierk
      Thanks for the quick response.

      Tried a simple random strategy using EMA. It still appears that limit orders do not work with multiple bars strategies. It could, of course, be my limited coding ability. The primary bars would be anything < 1000 ticks:

      protectedoverridevoid Initialize()
      {
      Add(PeriodType.Tick,
      1000);
      TraceOrders =
      true;
      CalculateOnBarClose =
      false;
      }
      protectedoverridevoid OnBarUpdate()
      {
      if(BarsInProgress !=0)

      return;

      if (BarsInProgress == 0)
      {
      if (CrossAbove(EMA(4), EMA(8), 1) && EMA(BarsArray[1], 4)[0]> EMA(BarsArray[1], 8)[0])
      {
      EnterLongLimit(
      100, GetCurrentAsk(0), "ELG");
      }
      }

      The results to the above are that any limit orders generated are immediately cancelled.

      Are there any examples of multiple bars strategies using limit orders?

      Thanks again

      NIKI

      Comment


        #4
        Hello,


        Working orders automatically cancelled if not resubmitted each bar. You will need to build this into your strategy to keep the orders working.

        This link may help:
        http://www.ninjatrader-support.com/H...verview36.html
        DenNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GMiller64, Today, 01:13 PM
        3 responses
        7 views
        0 likes
        Last Post GMiller64  
        Started by itrader46, Today, 12:51 PM
        4 responses
        32 views
        0 likes
        Last Post itrader46  
        Started by hemlock, Today, 11:45 AM
        3 responses
        9 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by gbulle, Today, 11:31 AM
        2 responses
        7 views
        0 likes
        Last Post gbulle
        by gbulle
         
        Started by JPPoulin, Today, 10:43 AM
        6 responses
        23 views
        0 likes
        Last Post JPPoulin  
        Working...
        X