Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Syncing strategy position after flat"

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

    "Syncing strategy position after flat"

    I have a custom unmanaged order mode strategy which I am testing in Sim101.
    At one point yesterday, the strategy's position size increased from one bar to the next without (as far as I could tell) there being any IOrder object associated with the increase.

    (The strategy uses entryOrder, targetOrder, stopOrder and flattenOrder IOrder objects. For debugging purposes, I record the values of these objects at the start and end of each OnBarUpdate, OnOrderUpdate, OnExecution, OnPositionUpdate, etc, and so can see that neither entryOrder, targetOrder, stopOrder nor flattenOrder changed values at the time Positions[0].Quantity increased by 1.)

    At the time of the above increase in position size, the log shows the following entry...


    Order='dabae2cc4516485197a998fc8f82a752/Sim101' Name='Syncing strategy position after flat' New state=PendingSubmit Instrument='YM 12-12' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''

    Order='dabae2cc4516485197a998fc8f82a752/Sim101' Name='Syncing strategy position after flat' New state=Accepted Instrument='YM 12-12' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    Order='dabae2cc4516485197a998fc8f82a752/Sim101' Name='Syncing strategy position after flat' New state=Working Instrument='YM 12-12' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    Order='dabae2cc4516485197a998fc8f82a752/Sim101' Name='Syncing strategy position after flat' New state=Filled Instrument='YM 12-12' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=1 Fill price=13290 Error=NoError Native error=''
    Execution='5a8113405349489e98ed34088fa85534' Instrument='YM 12-12' Account='Sim101' Exchange=Default Price=13290 Quantity=1 Market position=Long Operation=Insert Order='dabae2cc4516485197a998fc8f82a752' Time='12/12/2012 12:41:12 PM'

    Instrument='YM 12-12' Account='Sim101' Avg price=13284.5 Quantity=2 Market position=Long Operation=Update Currency=Unknown
    I suspect the above log entry is key to understanding what is happening, and to preventing the unwanted increase.

    Any ideas?

    #2
    Hello AnotherTrader,
    To assist you further can you please send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com

    Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

    I look forward to assisting you further.

    *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
    JoydeepNinjaTrader Customer Service

    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
    368 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
    571 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