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

Sync Chart-Trader's trade into strategy

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

    Sync Chart-Trader's trade into strategy

    i know the Start-Behavrior. I have:
    doptAccountPositionAware = true;
    StartBehavior = StartBehavior.AdoptAccountPosition;

    However, probably tha tis not relevant to this problem: i want a live-syncrhonization of Chart-Trader executions into strategy .

    For example, BOTH strategy is flat and Account is flat. My Strategy creates entries (with EnterLong), and then I use ChartTrader to exit.

    EnterLong() commands are are visible on chart, and it's executions are reflected into ChartTrader (i.e. CT can exit Strategy triggered orders).

    However, once i exit strategy-created entry, then strategy is unable to re-enter with EnterLong command (I use if(PositionAccount.MarketPosition == Mktp.Flat) EnterLong() ).

    So, the problem is that, when strategy fired an ENTRY order(and closed by ChartTrader), then it still sees strategy's internal position as "LONG" (even thought i manually reset `Position` property and successfully re-execute the EnterLong command, it no longer executes the order, it even doesnt reach to OnOderUpdate event)

    here is my code:
    Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.


    I tried another attempt (for that, check the "try_auto_change_order" chechbox), but that creates a double orders...

    will this help?: https://ninjatrader.com/support/help...ount_class.htm or this https://ninjatrader.com/support/foru...786#post437322



    need your help. thanks

    #2
    Hello TazoTodua,

    Thank you for the post.

    The only way that you could re-sync your strategy is by pressing "F5" to reload the NinjaScript objects on your chart. The entry is not occurring because your Strategy position is still not flat and your EntriesPerDirecton is likely = 1 (by default). After you have manually closed the position, and after you reload the NinjaScript, the strategy position will adopt the account position and will make its trades normally.

    Please let me know if I can assist further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      ouh, F5 method is highly non-solution to this problem...
      i am sure, that our golden NT should had a workaround for this.
      please, send that as request to Devs.

      I think, there should be a property in strategy, like:

      SynchronizeLiveAccountTradesFromChart = true/false

      Comment


        #4
        Hello TazoTodua,

        Thank you for the reply.

        I will submit a request to have this feature added in a future update. I will update this thread with a feature tracking ID shortly.

        Thanks in advance for your patience.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hello TazoTodua,

          Thanks for your patience.

          I have the feature tracking ID for the requested feature.

          SFT-3471

          Please check the release notes upon each release to track added features:



          Please let me know if I can assist further.
          Chris L.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,610 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