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.

    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:
        DenNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RubenCazorla, 08-30-2022, 06:36 AM
        3 responses
        77 views
        0 likes
        Last Post PaulMohn  
        Started by f.saeidi, Yesterday, 12:14 PM
        9 responses
        23 views
        0 likes
        Last Post f.saeidi  
        Started by Tim-c, Today, 03:54 AM
        0 responses
        3 views
        0 likes
        Last Post Tim-c
        by Tim-c
         
        Started by FrancisMorro, Today, 03:24 AM
        0 responses
        4 views
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,772 views
        0 likes
        Last Post Leafcutter  
        Working...
        X