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 bmartz, 03-12-2024, 06:12 AM
          4 responses
          31 views
          0 likes
          Last Post bmartz
          by bmartz
           
          Started by Aviram Y, Today, 05:29 AM
          4 responses
          12 views
          0 likes
          Last Post Aviram Y  
          Started by algospoke, 04-17-2024, 06:40 PM
          3 responses
          28 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by gentlebenthebear, Today, 01:30 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by cls71, Today, 04:45 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X