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 BarzTrading, Today, 07:25 AM
        2 responses
        14 views
        1 like
        Last Post BarzTrading  
        Started by devatechnologies, 04-14-2024, 02:58 PM
        3 responses
        19 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by tkaboris, Today, 08:01 AM
        0 responses
        3 views
        0 likes
        Last Post tkaboris  
        Started by EB Worx, 04-04-2023, 02:34 AM
        7 responses
        162 views
        0 likes
        Last Post VFI26
        by VFI26
         
        Started by Mizzouman1, Today, 07:35 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X