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

Strategy not getting Enabled maybe cuz Entry signals come from a secondary connection

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

    Strategy not getting Enabled maybe cuz Entry signals come from a secondary connection

    Hello

    I’m trying to test a simple strategy where the Entry signals are generated with ETFs/Indices data that comes via a secondary datafeed connection which is used to provide that ETFs/Indices instruments data for the strategy, and at the same time once an Entry signal is generated with that ETFs/Indices data, then the Entry order needs to be placed via a primary Futures datafeed connection. I.e. 2 datafeeds, one for the Entry signals and the other to place the orders.

    The reason to not to use only 1 single datafeed connection is because the primary datafeed provider only works with Futures and in this case the Entry signals are generated from ETFs/Indices data.

    Ok, having explained the overview of the situation, what I just noticed is when I try to activate the strategy, NT8 does kind of “loading” process attempt but some seconds later the strategy is disabled automatically without showing any kind of the strategy result on the chart (no orders shown, the strategy never is shown in green color in the Control Center, etc.).

    I tried to use only the primary datafeed, being the ETFs/Indices pre-loaded in the chart and in those cases I see the chart keep saying “Loading” for some seconds and then the strategy is disabled automatically. I also specified the Preferred connections in the Options / Market data, choosing the Futures datafeed provider in the Future sections.

    For the tests, I’m making sure the Futures datafeed connection be in first place (primary) in order that the Sim Account be using the Futures connection, however any of what I’ve tried seems to work. I also tried with a couple of strategies samples and those others get activated at the moment showing all the trades of the historical data in the chart etc.

    As reference, the strategy is being created in the NT8 Strategy Builder taking the Entry signals from an Indicator which has specified into its code the ETFs/Indices instruments etc. and at the moment to Enable the Strategy then I’m choosing a secondary Futures instrument that is also loaded in the chart, that is instrument where the orders need to be placed. The Indicator signals used as base for the strategy are working perfectly.

    Finally about the secondary datafeed connection I also tried with Kinetick EOD what comes with NT8 by default and the same null result.

    I couldn’t find other related post with similar topics, so I hope you can help me with the information provided here

    Thank you

    #2
    Hello futurenow,

    Thanks for your post.

    Please test running the SampleMACrossOver strategy that comes default with NinjaTrader.

    Are you able to get results when testing the SampleMACrossOver strategy?

    Please confirm that you have data for these symbols by loading the symbols in a New > Chart window. When applying these symbols to a New > Chart window, do you see the candles on the chart updating realtime?

    Also, please confirm that you are able to apply the SampleMACrossOver strategy on that data? Send a screenshot showing that the SampleMACrossOver strategy is enabled and running on that data.
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

    I look forward to assisting further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3

      Thank you for you reply

      Yes, when I tested with the SampleMACrossOver strategy using the Kinetick EOD data and it plots the results in the chart instantly as should as you can see in the picture below. I already confirmed I had data for the symbols, I see is not needed realtime data because the capture below was taken with EOD data and the SampleMACrossOver strategy loads without problems for the historical data.


      But I think I’ve found the possible section that is causing conflicts, that is the indicator has a set of pre-defined instruments strings names inside its code in the way of:
      Code:
      public class IndicatorName: Indicator
      {
      [FONT=Arial]    private string DataSeries1 = @"SPY";
          private string DataSeries2 = @"IWM";
          private string DataSeries2 = @"SPX";
      ...
      [/FONT]


      And I say that I think I’ve found the possible problem because making multiple tests in the Strategy Builder trying to see what is wrong or to find a way the strategy does anything, at least to plot a background color when certain condition is met, then I found that when in the Builder I erase the strings of the pre-defined instruments names leaving the fields “in blank” into the Indicator’s Parameters section (see picture below), then the Strategy start to load into the chart and start doing any basic thing like for example to plot a background color when a MACD condition is met.

      As an idea after thinking a little bit about it, maybe would be any way to specify into the Indicator code to “ignore” these Parameters when working with a strategy? Or some other more efficient way you have to manage these cases? Because it seems that are these Parameters that are causing conflicts at the moment to use the indicator to build a strategy, and in this way to be able to keep using the Indicator as normal being able to modify those strings that specify the instruments names into the Indicator’s properties (as for the moment), but at the same time that the indicator also be compatible to build a strategy from it without conflicts or issues.

      Thank you

      Click image for larger version

Name:	SampleMACrossOver strategy working properly with Kinetick EOD data.PNG
Views:	345
Size:	126.5 KB
ID:	1184831

      Click image for larger version

Name:	Strings that specify multiple symbols needed into the Indicator seems to be causing conflics at the moment to create a Strategy from it 1.png
Views:	184
Size:	35.7 KB
ID:	1184832

      Click image for larger version

Name:	Strings that specify multiple symbols needed into the Indicator seems to be causing conflics at the moment to create a Strategy from it 2.png
Views:	192
Size:	42.6 KB
ID:	1184833



      Comment


        #4
        As extra note, I want to clarify that the indicator with those multiple instruments etc. is working as should when it is used alone, loaded in a chart in a standard way as you could use the MACD or any other, i.e. the indicator perfectly loads all the instruments specified into those strings fields, it generates the Entry Signals as should without problems too, everything smooth as should, and also the instruments can be modified without problems when in the chart you go to: Indicators / Indicator Properties / Parameters, so for now the conflicts only come when I try to build a Strategy using the Indicator as base to take from it the Entry signals that it already generates as should.
        Last edited by futurenow; 01-07-2022, 01:57 PM.

        Comment


          #5
          Hello BrandonH,

          I still have the exact same situation described above in the post #3:
          Hello I’m trying to test a simple strategy where the Entry signals are generated with ETFs/Indices data that comes via a secondary datafeed connection which is used to provide that ETFs/Indices instruments data for the strategy, and at the same time once an Entry signal is generated with that ETFs/Indices data, then the


          Is there any news about how to handle these cases?

          Thank you

          Comment


            #6
            Hello futurenow,

            Thanks for your note.

            Dynamically adding data series to a NinjaScript generally will not work in all use cases. This could be seen in the AddDataSeries() help guide page linked below.

            From the help guide: Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error

            AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm

            You could consider modifying a copy of the script by hard-coding the series that you would like to use. Otherwise, you would need to use a different indicator that would allow you to accomplish your goal.

            Let us know if we may assist further.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kujista, Today, 06:23 AM
            0 responses
            1 view
            0 likes
            Last Post kujista
            by kujista
             
            Started by traderqz, Yesterday, 04:32 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by f.saeidi, Today, 05:56 AM
            1 response
            4 views
            0 likes
            Last Post Jltarrau  
            Started by Jltarrau, Today, 05:57 AM
            0 responses
            4 views
            0 likes
            Last Post Jltarrau  
            Started by Stanfillirenfro, Yesterday, 09:19 AM
            7 responses
            52 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X