Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 bortz, 11-06-2023, 08:04 AM
        47 responses
        1,609 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        9 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        19 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        6 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        16 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X