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

Issues while using custom indicator to write strategy

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

    Issues while using custom indicator to write strategy


    Hi ,

    I have custom indicator which is working fine and DLL also is there but the same is not able to use through strategy builder. Can you please help me how to use to create custom strategy :

    public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
    {
    private VOLAREIndicators.Volare_SuperTrendNewV2[] cacheVolare_SuperTrendNewV2;
    public VOLAREIndicators.Volare_SuperTrendNewV2 Volare_SuperTrendNewV2(BarsPeriodType _barsPeriodType, int _barsPeriod, int period, int factor)
    {
    return Volare_SuperTrendNewV2(Input, _barsPeriodType, _barsPeriod, period, factor);
    }

    public VOLAREIndicators.Volare_SuperTrendNewV2 Volare_SuperTrendNewV2(ISeries<double> input, BarsPeriodType _barsPeriodType, int _barsPeriod, int period, int factor)
    {
    if (cacheVolare_SuperTrendNewV2 != null)
    for (int idx = 0; idx < cacheVolare_SuperTrendNewV2.Length; idx++)
    if (cacheVolare_SuperTrendNewV2[idx] != null && cacheVolare_SuperTrendNewV2[idx]._BarsPeriodType == _barsPeriodType && cacheVolare_SuperTrendNewV2[idx]._barsPeriod == _barsPeriod && cacheVolare_SuperTrendNewV2[idx].Period == period && cacheVolare_SuperTrendNewV2[idx].Factor == factor && cacheVolare_SuperTrendNewV2[idx].EqualsInput(input))
    return cacheVolare_SuperTrendNewV2[idx];
    return CacheIndicator<VOLAREIndicators.Volare_SuperTrendN ewV2>(new VOLAREIndicators.Volare_SuperTrendNewV2(){ _BarsPeriodType = _barsPeriodType, _barsPeriod = _barsPeriod, Period = period, Factor = factor }, input, ref cacheVolare_SuperTrendNewV2);
    }

    #2
    Hello shankar.deshapande,

    Thank you for your post.

    See the help guide page below demonstrating how to make indicator to value comparisons using the Strategy Builder. Is the custom indicator not showing up in the Indicators folder when creating conditions and actions on the Conditions and Actions screen of the Strategy Builder?
    Strategy Builder Indicator to Value Comparisons - https://ninjatrader.com/support/help...lueComparisons

    Does the custom indicator use AddPlot() to create a plot and assigns a value to that plot?
    AddPlot() - https://ninjatrader.com/support/help...t8/addplot.htm

    Please note that the Strategy Builder only allows the use of indicators that contain a plot and assigns a value to that plot.

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

    Comment


      #3
      Hi ,
      Thanks for reply. Yes .Custom indicator showing in strategy builder conditions and action screen.but when i select and add conditions and try to compile it fails compilation and it is not showing any error also. where can i see error and attached is screenshot.

      Regards,
      Shankar
      Attached Files

      Comment


        #4
        Hello shankar.deshapande,

        Thank you for that information.

        Do you see any error messages occurring in the Log tab of the Control Center when you get the message stating your strategy cannot compile?

        Ultimately, if the Strategy Builder is unable to compile, I suggest closing the Strategy Builder and opening a new Strategy Builder to create a new strategy. This time, instead of selecting 'Compile' you should select the 'Unlock code' button in the Strategy Builder and then click the 'Compile' button in the NinjaScript Editor window. This will then allow you to view the compile errors that occur.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        1 response
        16 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 alifarahani, Today, 09:40 AM
        5 responses
        23 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X