Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

8.0.4 strategies UI save logic CC vs charts

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

    8.0.4 strategies UI save logic CC vs charts

    Dear NT team,

    I see some inconsistencies in how 8.0.4 works/saves strategies which are added to charts:
    - the strategy settings UI form has "enabled" checkbox, but that checkbox is not functional. A strategy in fact can only be enabled from the strategies tab in the CC. It would be better if the box was functional (or grayed out or removed).
    - here is a sequence to test 1) strategy enabled on chart; 2) strategy disabled from CC but not removed 3) workspace with the chart saved and then closed. When that workspace is restored, the chart does not include the strategy (If, however, the workspace was saved with the strategy enabled it is correctly restored when the workspace is re-opened.)
    - I cannot reproduce the exact sequence yet, but once so often strategies added from the chart remain in the CC even if no longer on the chart. This seems to occur after the chart instrument (or timeframe) was changed with the strategy still enabled. These strategies also seem to become "orphaned" and produce an error "A hosted indicator tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state." The correct UI logic seems to remove or update strategies once the chart is changed.

    Regards,
    Roman

    #2
    Hello roman_ch,

    Thanks for your post.

    I have not been able to replicate your observations.

    In 8.0.4.0 there has been a change that relates to the "hosted" error message you are seeing and wonder if that is not the cause of what you are seeing. If you have a strategy that calls an indicator and the indicator has the AddDataSeries() this means that in 8.0.4.0 you will now have to load the added dataseries in the strategy. From the helpguide:
    Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddDataSeries() calls as those hosted scripts would.
    Here is the link to where that is found (in the "Warning" section): http://ninjatrader.com/support/helpG...dataseries.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello Paul,

      Thank you for the quick response. I have now tested NT "factory" Sample MA cross and I had no issues with that. I have also tested the strategies I am using on several machines and I could repeat the problems I was referring to. Plainly, it is the code then.

      I am not using nested dataseries. I will do some further testing, but in the meantime, I can say that I have a call to Xaml.Loader() in State == DataLoaded and this might prevent the "enable" checkbox working from the chart (if the modal strategy settings window is blocking the loader call). I can't see why this would prevent saving, perhaps, something else is at play.

      I will follow up if I can't resolve.

      Regards,
      Roman

      Comment


        #4
        Paul,

        As a follow up on this thread, and for the benefit of development/community, here is some information on the issues I was having with enabling strategies from a chart.

        My code creates WPF UI elements in a strategy (I trust this must be something that can be expected by the NT dev team).

        Generally WPF allows to create UI elements only from the main thread of the application and the issues I was/am having were/are thread-related: when a strategy is enabled from a chart, it is not owned by the main thread; by comparison, when a strategy is enabled from the Control Center, it is owned by the main thread.

        Consequently, my strategy cannot be enabled from a chart, only from the Control Center.

        There are quick workarounds to create UI elements from other threads (eg though Invoke()), but these do not work great because I could not make straightforward data binding work with the properties of strategy (these properties will be owned by the non-UI thread, of course).

        This does not seem to be a good design because in principle a strategy must allow easy creation of UI elements (irrespective of where it is being enabled from).

        Whilst there can be reasons why NT functions in this way, it might be worth taking a look into this at some point and/or documenting in the helpguide.

        Regards,
        Roman

        Comment


          #5
          Hello roman_ch,

          Thanks for your post.

          Can you provide us with a simplified strategy that demonstrates the issue you are seeing along with the specific steps to recreate?

          Thanks again for your detailed response.
          Paul H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by alifarahani, Today, 09:40 AM
          6 responses
          27 views
          0 likes
          Last Post alifarahani  
          Started by Waxavi, Today, 02:10 AM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by Kaledus, Today, 01:29 PM
          5 responses
          13 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Waxavi, Today, 02:00 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by gentlebenthebear, Today, 01:30 AM
          3 responses
          17 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X