• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Call an Indicator from an Add-On ?

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

    Call an Indicator from an Add-On ?

    Is there any way to call an indicator from an Add-On?

    I currently have an Add-On where I load many BarsRequests through a file (more than one hundred requests). The Add-On is subscribed to the OnBarUpdate, OnMarketData and OnMarketDepth events and performs calculations with that Level1 and Level2 data for each Request.BarsRequest. For now, everything works fine.

    However, now I need to include some calculations based on an indicator. One solution would be to copy/paste the indicator code in the Add-On. But I'd prefer to make the call. The main problem I see is that the BarsRequest.Bars property is not supported by the indicators as a data source, so I do not see how to provide the ISerie to the indicator.

    Another solution would be to invoke an event to the receiver (strategy) which would perform the calculations.

    But as I say, I would prefer that the Add-On performs the calculations internally by calling the indicator, if is possible.

    Thanks
    Last edited by cls71; 04-27-2018, 10:11 AM.

    #2
    Hello cls71,

    Thanks for opening the thread.

    Currently there is not a supported means to call an indicator from an AddOn. The advised approach would be to add the indicator code to the AddOn. Series<double>'s can be synced to the BarsRequest.Bars object, however it should be noted this will start creating new slots with realtime iterations by the BarsRequest.

    For example:
    Code:
    barsRequests[i].Request(new Action<BarsRequest, ErrorCode, string>((bars, errorCode, errorMessage) =>
    {
    	if (errorCode != ErrorCode.NoError)
    	{
    		// Handle any errors in requesting bars here
    		NinjaTrader.Code.Output.Process(string.Format("Error on requesting bars: {0}, {1}",
    				errorCode, errorMessage), PrintTo.OutputTab1);
    		return;
    	}
    	
    	myCloses = new Series<double>(bars.Bars, MaximumBarsLookBack.TwoHundredFiftySix);
    We also have a feature request tracking interest in being able to call indicators from other NinjaScripts like AddOns and Drawing Tools. I will submit a vote on your behalf. The ticket ID is SFT-2362.

    Please keep in mind, feature requests are fulfilled based on the development team's priorities and we cannot offer an ETA or promise of fulfillment. Upon implementation, the ticket ID's can be seen in the Release Notes page of the help guide.

    Release Notes: https://ninjatrader.com/support/help...ease_notes.htm

    If there is anything else we can do to help, please let us know.
    Last edited by NinjaTrader_Jim; 04-27-2018, 08:45 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      Could you add my vote to this as well please Jim?

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kujista, Today, 12:59 AM
      0 responses
      1 view
      0 likes
      Last Post kujista
      by kujista
       
      Started by Gerik, Today, 12:14 AM
      0 responses
      3 views
      0 likes
      Last Post Gerik
      by Gerik
       
      Started by Bionian, Yesterday, 11:47 PM
      0 responses
      2 views
      0 likes
      Last Post Bionian
      by Bionian
       
      Started by adambrul, Yesterday, 11:34 PM
      0 responses
      2 views
      0 likes
      Last Post adambrul  
      Started by benjamind10, Yesterday, 07:27 PM
      0 responses
      6 views
      0 likes
      Last Post benjamind10  
      Working...
      X