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

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, 11: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, 09: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 DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      6 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Working...
      X