Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TO Koganam: HELP!!!! (please)

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

    TO Koganam: HELP!!!! (please)

    The following error messages were displayed when trying to upgrage NT7 strategy Koganam to NT8. Kindly please help me out at you convenience.
    Thanks,
    JoeMiller

    [Click image for larger version

Name:	NOV20 Koganam1.JPG
Views:	1
Size:	199.6 KB
ID:	906561
    Click image for larger version

Name:	NOV20 Koganam2.JPG
Views:	1
Size:	68.1 KB
ID:	906562

    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Indicator;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Strategy;
    #endregion

    // ****************** ORIGINAL COPY FROM KOGONAM *****************

    // This namespace holds all strategies and is required. Do not change it.
    namespace NinjaTrader.Strategy
    {
    /// <summary>
    /// variable0 = +1 or -1 for current position = long or short or 0 = flat. Entry signal is red/green bar change confrirmed by a second red/green bar in the same direction.
    /// </summary>
    [Description("variable0 = +1 or -1 for current position = long or short or 0 = flat. Entry signal is red/green bar change confrirmed by a second red/green bar in the same direction.")]
    public class Koganam : Strategy //WAS SwingRedBlueBars2
    {
    #region Variables
    // Wizard generated variables
    private int profitGoal = 16; // Default setting for ProfitGoal
    private int stopLoss = 16; // Default setting for StopLoss
    // User defined variables (add any user defined variables below)
    private int calcIndex = 0; //we shall use this to adjust our bar references
    #endregion

    /// <summary>
    /// This method is used to configure the strategy and is called once before any strategy method is called.
    /// </summary>
    protected override void Initialize()
    {
    SetProfitTarget("L", CalculationMode.Ticks, ProfitGoal);
    SetStopLoss("L", CalculationMode.Ticks, StopLoss, false);
    SetProfitTarget("S", CalculationMode.Ticks, ProfitGoal);
    SetStopLoss("S", CalculationMode.Ticks, StopLoss, false);

    CalculateOnBarClose = false;
    }

    protected override void OnStartUp()
    {
    if (Account.Name == "Backtest") //this means that we are in the Strategy Analyser
    calcIndex = 0;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    if (CurrentBar < 2) return;

    if (!Historical) calcIndex = 0;
    else calcIndex = 1;

    // Condition set 1
    if (Close[1 - calcIndex] >= Open[1 - calcIndex]
    && Close[2 - calcIndex] >= Open[2 - calcIndex]
    && Variable0 == 0)
    {
    EnterLong(DefaultQuantity, "L");
    Variable0 = 1;
    }

    // Condition set 2
    if (Close[1 - calcIndex] <= Open[1 - calcIndex]
    && Close[2 - calcIndex] <= Open[2 - calcIndex]
    && Variable0 == 0)
    {
    EnterShort(DefaultQuantity, "S");
    Variable0 = -1;
    }

    // Condition set 3
    if (Position.MarketPosition == MarketPosition.Flat)
    {
    Variable0 = 0;
    }
    }

    #region Properties
    [Description("Profit Goal [ticks]")]
    [GridCategory("Parameters")]
    public int ProfitGoal
    {
    get { return profitGoal; }
    set { profitGoal = Math.Max(1, value); }
    }

    [Description("Stop Loss [ticks]")]
    [GridCategory("Parameters")]
    public int StopLoss
    {
    get { return stopLoss; }
    set { stopLoss = Math.Max(1, value); }
    }
    #endregion
    }
    }

    #2
    Hello joemiller,

    You have code that is NinjaTrader 7 code that is not compatible with NinjaTrader 8.

    NinjaTrader 7 scripts are not compatible with NinjaTrader 8 as there are many code breaking changes.

    I recommend that when attempting to port a script to NT8, you use the Strategy Builder to create as much of the script as possible before including the logic.
    The Strategy Builder will first generate the structure of the script. Also, create any inputs with the Strategy Builder as well.

    Initialize() cannot be used in NinjaTrader 8. The uses the OnStateChange Method with States. (The Strategy Builder will create this for you).

    OnStartUp() cannot be used in NinjaTrader 8.

    Variable0 does not exist in NinjaTrader 8. (You can create your own private variables now)

    [GridCategory("Parameters")] is no longer a valid attribute tag.
    Last edited by NinjaTrader_ChelseaB; 11-20-2016, 06:11 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea and once again, thanks Koganam, for the original code.

      One question regarding ''use the Strategy Builder to create as much of the script as possible'' [i.e.]
      I expected you to say ''Strategy Wizard'' instead of ''Strategy Builder''. I found Strategy Builder in the Help Guide but want to make sure I should be using the Builder instead of the Wizard before getting on the Builder learning curve.

      Comment


        #4
        Originally posted by joemiller View Post
        Thanks Chelsea and once again, thanks, Koganam, for the original code.

        One question regarding ''use the Strategy Builder to create as much of the script as possible'' [i.e.]
        I expected you to say ''Strategy Wizard'' instead of ''Strategy Builder''. I found Strategy Builder in the Help Guide but want to make sure I should be using the Builder instead of the Wizard before getting on the Builder learning curve.
        Hi Chelsea,
        Please reply soon as you get a moment. I have some time I can devote to this and need some direction to optimize my time. In the meantime I'm working on something else.

        Comment


          #5
          Hello joemiller,

          Thank you for your note.

          Strategy Builder is the Strategy Wizard in NinjaTrader 8.

          Comment


            #6
            Originally posted by NinjaTrader_PatrickH View Post
            Hello joemiller,

            Thank you for your note.

            Strategy Builder is the Strategy Wizard in NinjaTrader 8.
            thanks.

            my confusion was that both terms are used in the help guide [see attachment]
            maybe they say the same thing ... i will take a look when i get a moment.

            Click image for larger version

Name:	NOV21.jpg
Views:	2
Size:	217.3 KB
ID:	881184

            Comment


              #7
              Originally posted by NinjaTrader_PatrickH View Post
              Hello joemiller,

              Thank you for your note.

              Strategy Builder is the Strategy Wizard in NinjaTrader 8.
              my confusion was that both are in the help guide [see attachment].
              i will take a look to see if they say the same thing when i get a moment.

              Click image for larger version

Name:	NOV21.jpg
Views:	2
Size:	217.3 KB
ID:	881185

              Comment


                #8
                Originally posted by joemiller View Post
                my confusion was that both are in the help guide [see attachment].
                i will take a look to see if they say the same thing when i get a moment.

                [ATTACH]41366[/ATTACH]
                The help guide says:
                ''The Strategy Builder is used to generate NinjaScript based strategies for automated systems trading. The Strategy Builder can be opened by left mouse clicking on the New menu within the NinjaTrader Control Center, and selecting the menu item Strategy Builder.''

                However, when i do that i am greeted with
                Click image for larger version

Name:	NOV22.jpg
Views:	1
Size:	42.7 KB
ID:	881201
                what should i do?
                In the meantime i will go directly to ninjascript wizard. maybe that will get me started?

                Comment


                  #9
                  too confusing ... i'm contacting platformsupport

                  Comment


                    #10
                    Hello joemiller,

                    Thank you for your time yesterday.

                    Please let us know if we may be of further assistance.

                    Comment


                      #11
                      This is a big forum and I am lost haha. Im looking for a thread or member that knows about Automated Strategies for NT7 CL that shoots for small targets. Pretty much a scalping Bot. Can anyone point me in the right direction please?

                      Adam

                      Comment


                        #12
                        Originally posted by dreadchampion View Post
                        This is a big forum and I am lost haha. Im looking for a thread or member that knows about Automated Strategies for NT7 CL that shoots for small targets. Pretty much a scalping Bot. Can anyone point me in the right direction please?

                        Adam
                        wish i could help you dreadchampion but i only know enough to be dangerous. i don't even know what ''CL'' AND ''Bot'' mean. good luck though, i know the lost feeling.

                        i am just starting to come up to speed with using the NT8 debugger after many forum posts and platform support emails. it may well be worth it for you to upgrade to NT8 if you have the time ... it's a nice piece of software.

                        cheers & peace

                        Comment


                          #13
                          Originally posted by joemiller View Post
                          wish i could help you dreadchampion but i only know enough to be dangerous. i don't even know what ''CL'' AND ''Bot'' mean. good luck though, i know the lost feeling.

                          i am just starting to come up to speed with using the NT8 debugger after many forum posts and platform support emails. it may well be worth it for you to upgrade to NT8 if you have the time ... it's a nice piece of software.

                          cheers & peace
                          Hey Joe,

                          Haha, well I appreciate the response anyways. CL is the Crude Oil Futures Market; my fave to trade because of the constant volatility. And Bot is just short for Robot, or EA or Automated Trading Strategy.

                          Is NT8 finally getting up to speed? Ive heard from multiple traders and brokers that it is still best to stay with NT7 because NT8 has so many bugs still that it is dangerous to switch to it, and that it wont be worth even looking at till a year from now at least....

                          Adam

                          Comment


                            #14
                            Hello dreadchampion,

                            Thank you for your post.

                            NinjaTrader 8 is released and we will continue to look to improve the application. You can find more information at the following link: http://ninjatrader.com/LP/NT8_Future...-NinjaTrader-8

                            Comment


                              #15
                              Originally posted by NinjaTrader_PatrickH View Post
                              Hello dreadchampion,

                              Thank you for your post.

                              NinjaTrader 8 is released and we will continue to look to improve the application. You can find more information at the following link: http://ninjatrader.com/LP/NT8_Future...-NinjaTrader-8
                              Thanks Patrick. Its been a while since I have looked into NT8. Also, sent you a reply PM...

                              Adam

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Yesterday, 05:17 AM
                              0 responses
                              61 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              134 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              75 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              45 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              50 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X