Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AI Generate custom indicator?

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

    AI Generate custom indicator?

    Hi,

    Can I use a custom indicator with the AI Generate optimization?
    If so, any direction would be appreciated.

    Thanks,
    Erik

    #2
    Yes, if the custom indicator only uses one data series.

    See the following walk-through, and expand the section How to Run an AI Generate Optimization:

    https://ninjatrader.com/support/help...i-generate.htm
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello Erik,

      The AI Generator is not designed to produce indicators. This instead is using a set of pre listed indicators to find combinations of conditions that place orders and lead to a performance result.

      It's not designed to set plot values or draw objects, or do things that indicators do.

      That said, you can copy the logic from a strategy to a new indicator script and remove any order related code.

      Below is a link to a video about copying code from one script to another.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi all thanks for the responses.

        I have an indicator called "MyInd".
        I added it her:

        Code:
            public class StrategyGenerator : Optimizer
            {
                private int                        oldKeepBestResults            = -1;
                private    ChartPattern[]            selectedCandleStickPattern;
                private Type[]                    selectedIndicatorTypes;
        
                public    static ChartPattern[]    AvailableCandleStickPattern    = Enum.GetValues(typeof(ChartPattern)).Cast<ChartPattern>().ToArray();
        
                // Subjective selection of indicators which 'make most sense'. The full set of indicators would be used if this selection would not be set
                // The optional tuple defines the range of random comparison values for oscillators (where such range could be defined)
                // Feel free to modify to your liking...
                internal    static Dictionary<Type, Tuple<double, double>> AvailableIndicators = new Dictionary<Type, Tuple<double, double>>()
                                                                {
                                                                    { typeof(Indicators.MyInd),                       null },
                                                                    { typeof(Indicators.ADL),                       null },​
        It shows up when I run AI Generate as an indicator I can select for my AI Optimization.
        When I try to run the AI Generate with "MyInd" selected as one of the indicators to use the application hangs.

        Can anyone give me any ideas on what I may be doing wrong and\or if this is possible to do?

        Thanks,
        Erik

        Comment


          #5
          Hello Erik,

          This appears to be code for a custom optimizer script and not an indicator.

          This would imply you are not using the AI Generate or you have posted the code from the wrong script.

          That said, I would recommend you comment out all of the logic and variables and ensure the issues does not occur, then uncomment (blocks) of variables first, then logic one line at a time, until the behavior returns. There may be issues (such as improper auto setters that get stuck in a loop) causing the behavior.
          Commenting out code will help you zero in on the specific line causing the error.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by byteman, Today, 11:59 AM
          3 responses
          21 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by aligator, Yesterday, 06:32 PM
          2 responses
          40 views
          0 likes
          Last Post AndyM
          by AndyM
           
          Started by gravdigaz6, 06-05-2022, 01:40 AM
          2 responses
          214 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Zazzgram91, Today, 10:14 AM
          3 responses
          20 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by several, Today, 07:07 AM
          7 responses
          20 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X