Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StartBehavior.AdoptAccountPosition behaviour question

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

    StartBehavior.AdoptAccountPosition behaviour question

    Hi,

    I have a strategy that uses StartBehavior.AdoptAccountPosition to enable it to resume after the forced IB daily disconnect.

    If the strategy is in a position and it disables itself due to connection loss, I then reconnect and enable it, and it does a "Virtual entry execution" to keep in sync, which is fine.

    The problem arises later on, when the strategy logic encounters an exit signal such as:

    Code:
    ExitLong(entryName+"LIFail",entryName);
    where the original entryName (fromEntrySignal) is no longer recognized by the strategy, and therefore this Exit order is never triggered. This in an intra-bar signal.

    Is this normal behavior? If so, how do I deal with these virtual entries to make sure all the exit signals are triggered after a virtual entry?

    Thanks.

    #2
    Hello ours_solaire,

    Thank you for your note.

    May I ask, do you have both the following under State.SetDefaults?

    Code:
    IsAdoptAccountPositionAware = true;
    IsInstantiatedOnEachOptimizationIteration	= true;
    If so, if you hardcode "enterLong" as the name for both the entry and exit, do you get the exit upon the conditions being met after a restart?

    I look forward to your reply.
    Last edited by NinjaTrader_AlanP; 09-26-2017, 07:58 AM.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi Alan,

      Yes those parameters are correctly set in State.SetDefaults.

      I can see that if you don't specify a fromEntrySignal in your EXIT() method by using an empty string, the exit order will always trigger, however, if I want to keep a track of which entry signal generated the exit (using fromEntrySignal), I can't use this method.

      Ideally, there would be a boolean such as IsVirtualEntry that could be used to catch these instances and deal with them differently.

      Perhaps you can add this to the list of requests / modifications for a future update of NT?

      Comment


        #4
        Hello ours_solaire,

        Interesting, I'd like to look more into this.

        Could you please send an email to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and attach the log and trace files for the day in subject which you can find in My Documents>NinjaTrader8>Log and My Documents>NinjaTrader8/Trace folders.

        I look forward to your email.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        58 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        197 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        362 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        282 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X