Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Regarding My strategy

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

    Regarding My strategy

    Hello:

    I have an Abstract MyCustomizedStrategy class which inherits from Strategy class. the idea is that the Code is extensive and I dont want to search through the entire code to look for my signals, besides makes it easier to create strategies within minutes( all I need to do is enter the Entry and Exit Signals). Inside MyCustomizedStrategy Class I have a Secondary Series, An Operating Mode( BackTest vs RealTime). All of My strategies inherit from MyCustomizedStrategy. When I initialize them( the strategies) I have the following:

    protected override void Initialize()
    {
    CalculateOnBarClose = true;
    base.Initialize();
    //Adds another secondary series of UniRenkoBars
    Add(Instrument.FullName,PeriodType.Custom5,0090180 09);
    }
    The issue That I am having is the Following... To call this BarArray, Does NT first calls the operation modes before this custom Bars? Would my index be BarsArray[2] in this case and the Operation mode BarsArray[1]? this is the way it was when my signals where inside the extensive code...

    thank you
    Last edited by Yandychang; 12-22-2015, 01:16 PM.

    #2
    Hello,

    Thank you for the question.

    I am unsure of what you are asking with this question, could you provide a simple sample script that shows the structure/ properties you are using that are in question?

    It sounds like you are asking what order would the bars array be assigned, I would be unsure without seeing the full extent of the scripts and what is being added. With that I could run it and see what is occurring.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thats exactly my question.... If u give me ypur email I will send it to you...

      Comment


        #4
        Hello,

        You can email a sample into platform support @ ninjatrader.com, I would mainly just need to see the structure of your classes and how you are inheriting along with where you have added the additional series.

        It would be beneficial to omit any additional logic from the sample you create as we only are focusing on the BarsArray and order they are added.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Here, i got the Examples Here... This is an example of the custom Abstract class, and my strategy class
          Last edited by Yandychang; 12-23-2015, 12:53 PM.

          Comment


            #6
            Hello,

            Thank you for the reply.

            Unfortunately one of the files was blank and the other I do see the abstract class but am unsure what order the Add statements would occur in as you are using conditions to control them.

            Regarding your initial concern, the series should be added in the order you have defined by the conditions in the base and in the other script, also it would be presumed that because you are calling base.Initialize(); first the base series would be added first but this would need to be tested as you are calling it instead of it being called internally automatically.

            For this, I would suggest refining the code or to just make a simplified example instead of a large script to gain better understanding on your question. creating two samples scripts where one demonstrates only the abstract class and added series and the second that only demonstrates inheriting from that base and calling it as you have along with removing the conditions that are making it variable. would provide more details

            Additionally, what you are currently using would potentially only work correctly when applying the strategy initially, if conditions are used in Initialize for Add statements specifically, there is the chance if you disable and change a setting then re enable, that change may not occur as the strategy was not re applied to the chart but only reloaded.

            Please let me know if I may be of additional assistance
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thank you, I appreciate the Help... I figured out the mistaake I was having... I was not in the Adding the BarsArray... The bug was some where else and seemed to be affecting the order of the BarsArray.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ct, 05-07-2023, 12:31 PM
              6 responses
              202 views
              0 likes
              Last Post wisconsinpat  
              Started by kaywai, Today, 06:26 AM
              0 responses
              1 view
              0 likes
              Last Post kaywai
              by kaywai
               
              Started by kevinenergy, 02-17-2023, 12:42 PM
              118 responses
              2,778 views
              1 like
              Last Post kevinenergy  
              Started by briansaul, Today, 05:31 AM
              0 responses
              9 views
              0 likes
              Last Post briansaul  
              Started by traderqz, Yesterday, 12:06 AM
              11 responses
              28 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X