• 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, 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 Abilene, Today, 01:27 AM
      0 responses
      4 views
      0 likes
      Last Post Abilene
      by Abilene
       
      Started by simjs, Yesterday, 08:11 PM
      0 responses
      3 views
      0 likes
      Last Post simjs
      by simjs
       
      Started by mrlucky1x, Yesterday, 06:01 PM
      0 responses
      3 views
      0 likes
      Last Post mrlucky1x  
      Started by dedouglas, Yesterday, 03:17 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Jugado, Yesterday, 02:22 PM
      2 responses
      30 views
      0 likes
      Last Post Jugado
      by Jugado
       
      Working...
      X