Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EntryHandling bug report

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

    EntryHandling bug report

    Hi guy,s
    I have programmed a strategy that scales into a trade. Think of the entries as rungs on a ladder. All the rungs share the same price profit target. The code works perfectly for small position sizes, e.g. less than 50 contracts per rung.

    With larger numbers, where partial fills occur (this is in the Sim101 account), the EntryHandling code inside Ninja does not correctly determine that a position has completely closed.

    To re-state - lots of partial entry fills, with different EntrySignal strings, entered at different prices, which ALL FILL at the profit target and close. At this point, there is a bug in Ninja which is not correctly determining the positions have closed, and thus prevents new entries based on the EntryHandling and EntriesPerDirection settings.

    Please see excerpt below. (I've bolded the important bits.) The rungs of 100 contracts each all fill their profit target and are completely flat. Just to make double sure, the positions are asked to Exit as well, (which Ninja correctly says "does not have a matching EntrySignal".

    Then 'Rung02' is prevented from being put on again, because of the EntryHandling rules.This is incorrect. New entries should now be allowed.

    I have been around and around this for a great many hours, and I do not believe the strategy code is at fault. As I say, it works perfectly for smaller positions sizes.

    So, my question;
    1) Are you aware of this behaviour?
    2) If so, is it fixed in NT7?

    Many thanks,
    salminer
    www.tradingcoders.com

    Rungs have all filled at their profit target. Cancelling orders to then re-place the ladder's first rung
    11/09/2010 5:47:39 PM Entered internal PlaceOrder() method at 11/09/2010 5:47:39 PM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='Rung04'
    11/09/2010 5:47:39 PM Ignored PlaceOrder() method at 11/09/2010 5:47:39 PM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='Buy to cover' FromEntrySignal='Rung04' Reason='SignalName does not have a matching FromEntrySignal to exit'
    11/09/2010 5:47:39 PM Entered internal PlaceOrder() method at 11/09/2010 5:47:39 PM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='Rung03'
    11/09/2010 5:47:39 PM Ignored PlaceOrder() method at 11/09/2010 5:47:39 PM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='Buy to cover' FromEntrySignal='Rung03' Reason='SignalName does not have a matching FromEntrySignal to exit'
    11/09/2010 5:47:39 PM Entered internal PlaceOrder() method at 11/09/2010 5:47:39 PM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='Rung02'
    11/09/2010 5:47:39 PM Ignored PlaceOrder() method at 11/09/2010 5:47:39 PM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='Buy to cover' FromEntrySignal='Rung02' Reason='SignalName does not have a matching FromEntrySignal to exit'
    11/09/2010 5:47:39 PM Entered internal PlaceOrder() method at 11/09/2010 5:47:39 PM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='Rung01'
    11/09/2010 5:47:39 PM Ignored PlaceOrder() method at 11/09/2010 5:47:39 PM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='Buy to cover' FromEntrySignal='Rung01' Reason='SignalName does not have a matching FromEntrySignal to exit'
    11/09/2010 5:47:39 PM moving stoploss because rungs closed at profit.
    11/09/2010 5:47:39 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1237.25 Currency=0 Simulated=False
    11/09/2010 5:47:39 PM Amended stop order: Order='2e278ef836d1419b876848bb39ac681e/Sim102' Name='Stop loss' State=Accepted Instrument='ES ##-##' Action=BuyToCover Limit price=0 Stop price=1237.25 Quantity=10 Strategy='PDLadderTrader3_PF' Type=Stop Tif=Gtc Oco='816f929f28274650845a4179d069faaa' Filled=0 Fill price=0 Token='2e278ef836d1419b876848bb39ac681e' Gtd='1/12/2099 12:00:00 AM'
    11/09/2010 5:47:39 PM Amended stop order: Order='bab3a9e907a4480e8a1996d4f9d88ffa/Sim102' Name='Stop loss' State=Accepted Instrument='ES ##-##' Action=BuyToCover Limit price=0 Stop price=1237.25 Quantity=90 Strategy='PDLadderTrader3_PF' Type=Stop Tif=Gtc Oco='c43cec8bcf7f4e618e51c81ebcd06456' Filled=0 Fill price=0 Token='bab3a9e907a4480e8a1996d4f9d88ffa' Gtd='1/12/2099 12:00:00 AM'
    11/09/2010 5:47:41 PM Updating the AveragePrice used for this new rung formation to 1229.75
    11/09/2010 5:47:41 PM adding rung #1
    11/09/2010 5:47:41 PM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='Rung01' Mode=Price Value=1230 Currency=0 Simulated=False
    11/09/2010 5:47:41 PM Entered internal PlaceOrder() method at 11/09/2010 5:47:41 PM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=1231.25 StopPrice=0 SignalName='Rung01' FromEntrySignal=''
    execution : Rung01, Rung01, ; Execution='6f2fdeb091c3462ca6134afe2548332f' Instrument='ES ##-##' Account='Sim102' Name='Rung01' Exchange=Default Price=1231.25 Quantity=44 Market position=Short Commission=99 Order='a160078ae21144daa3b89dc1414c9b39' Time='11/09/2010 5:57:51 PM'
    11/09/2010 5:57:51 PM new fill entry at price 1231.25
    execution : Rung01, Rung01, ; Execution='9859752a37ad4e92a7f5a2bbd2472c1f' Instrument='ES ##-##' Account='Sim102' Name='Rung01' Exchange=Default Price=1231.25 Quantity=37 Market position=Short Commission=83.25 Order='a160078ae21144daa3b89dc1414c9b39' Time='11/09/2010 5:57:51 PM'
    11/09/2010 5:57:51 PM new fill entry at price 1231.25
    execution : Rung01, Rung01, ; Execution='f510dc94fbc74086ac5603941e2c3e19' Instrument='ES ##-##' Account='Sim102' Name='Rung01' Exchange=Default Price=1231.25 Quantity=19 Market position=Short Commission=42.75 Order='a160078ae21144daa3b89dc1414c9b39' Time='11/09/2010 5:57:52 PM'
    11/09/2010 5:57:52 PM new fill entry at price 1231.25
    11/09/2010 5:57:52 PM FullyFilled. Adjusting AveragePrice to 1230
    Updating rung profit targets to 1228.75
    11/09/2010 5:57:52 PM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='Rung04' Mode=Price Value=1228.75 Currency=0 Simulated=False
    11/09/2010 5:57:52 PM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='Rung03' Mode=Price Value=1228.75 Currency=0 Simulated=False
    11/09/2010 5:57:52 PM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='Rung02' Mode=Price Value=1228.75 Currency=0 Simulated=False
    11/09/2010 5:57:52 PM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='Rung01' Mode=Price Value=1228.75 Currency=0 Simulated=False
    11/09/2010 5:57:52 PM Amended target order: Order='e1937fa7f82b4feda0bd95454ed7861f/Sim102' Name='Profit target' State=Working Instrument='ES ##-##' Action=BuyToCover Limit price=1228.75 Stop price=0 Quantity=44 Strategy='PDLadderTrader3_PF' Type=Limit Tif=Gtc Oco='6f2fdeb091c3462ca6134afe2548332f' Filled=0 Fill price=0 Token='e1937fa7f82b4feda0bd95454ed7861f' Gtd='1/12/2099 12:00:00 AM'
    11/09/2010 5:57:52 PM Amended target order: Order='6165d755213446059927b800f5980f14/Sim102' Name='Profit target' State=Working Instrument='ES ##-##' Action=BuyToCover Limit price=1228.75 Stop price=0 Quantity=37 Strategy='PDLadderTrader3_PF' Type=Limit Tif=Gtc Oco='9859752a37ad4e92a7f5a2bbd2472c1f' Filled=0 Fill price=0 Token='6165d755213446059927b800f5980f14' Gtd='1/12/2099 12:00:00 AM'
    11/09/2010 5:57:52 PM Amended target order: Order='7b739fe883fc475a8919b09413937177/Sim102' Name='Profit target' State=Working Instrument='ES ##-##' Action=BuyToCover Limit price=1228.75 Stop price=0 Quantity=19 Strategy='PDLadderTrader3_PF' Type=Limit Tif=Gtc Oco='f510dc94fbc74086ac5603941e2c3e19' Filled=0 Fill price=0 Token='7b739fe883fc475a8919b09413937177' Gtd='1/12/2099 12:00:00 AM'
    11/09/2010 5:57:52 PM adding rung #2
    11/09/2010 5:57:52 PM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='Rung02' Mode=Price Value=1231.5 Currency=0 Simulated=False
    11/09/2010 5:57:52 PM Entered internal PlaceOrder() method at 11/09/2010 5:57:52 PM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=1232.75 StopPrice=0 SignalName='Rung02' FromEntrySignal=''
    11/09/2010 5:57:52 PM Ignored PlaceOrder() method at 11/09/2010 5:57:52 PM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=1232.75 StopPrice=0 SignalName='Rung02' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
    11/09/2010 5:57:53 PM adding rung #2

    #2
    saltminer, just to clarify, this is on NT6.5? Can you please send us your code so we can test this out? There have been quite a few order handling enhancements for NT7, so please downloading and installing NT7 and see if the problem persists.
    AustinNinjaTrader Customer Service

    Comment


      #3
      I will have to check back with my client - the code is covered by an NDA.
      Yes, it is for 6.5, latest version as of September 1st 2010.
      saltminer

      Comment


        #4
        Thanks saltminer, please report back if you see the same issue on NT7, which contains many fixes and enhancements in this area as well.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X