Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Automation Strategy Copy

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

    Automation Strategy Copy

    Hi

    I have develloped a simple Strategy for auto. trading.

    I want to trade it for several future markets (e.g. ES; ZB; E6 etc.)

    I presume I would do this trough the Control Center Stragegies Tab by selecting new stategy and then chose from avaiable strategies.

    As the setting are different for every market, I need to type them in for every of the markets I want to trade - and next time I open NT againg I have to go trough the same process again - Is there an easier way around this?


    I presume in the strategy Wizard I could make identical strategies and name them by markets and set the parameters for ecery market - this leads me to my second question - how can I copy an all ready existing Strategy for above porpuse or if I wanted to develope an existing strategy further without changing the old one.

    Thank you and look forward to hear from one one who can help me.

    Michael Larsen

    #2
    Hello Michael,

    You can initiate strategies via the Strategies-tab, but also via a chart.

    Please see the links below.

    Strategies-tab:


    Chart:


    You will be able to save the Strategy settings in NinjaTrader 7.

    Unfortunately this is not supportted in NinjaTrader 6.5.

    You can copy code via Tools-->Edit NinjaScript-->Strategy.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Automated Trading

      Hi Jason

      Thanks for you fast reply, kind of you.

      You answer is understood and clear - I do however think that the difference between char and Strategy Tab entry is that in char entry of a strategy you can not change the number of contracts you wish to trade.

      Anyway I have a nother problem:

      Yesterday I started a strategy (via strategy tab) the settings under "Time frame" was:

      Sessions begins: 14:00
      Session ends 15:20

      Order handling was set to Exit at close

      (I am on European time)

      This worked all very well the open position was closed just a few seconds before 15:20

      But now today when I enter the same strategy for the same market (via the stategy tab in control center) It showes an open position.

      The is however nothing open if I click on the positions tab in control center, now is any executuons showed

      What is wrong?

      Comment


        #4
        Hello Michael,

        This can be as expected and is related to the possible difference between a strategy position and an account position. Please review the information listed at the link below.


        Your strategy is in a position due to its calculations on historical data, while your account is not in a position.

        In addition, you should be able to select the order quantity upon initiating a strategy in the chart as well, see screenshot.
        Attached Files
        JasonNinjaTrader Customer Service

        Comment


          #5
          Ato trading

          Hi

          Thanks for your reply - The exampel in the link you provided is not 1005 clear to me - I need to make a market ordet in the opposit of the one in the strategy - where? - in the actual account ? - If I do this i will be holding an actual position wont I?

          Comment


            #6
            Hello Michael,

            You would need to submit a market order manually to the account you run the automated strategy. This will result in an account position, but synchronizes the strategy position and account position.

            However, you could also enable 'Wait until flat before executing live' at Tools-->Options-->Strategies-->NinjaScript. Your startegy will only submit orders until your strategy position is flat.

            In addition, you could also include the following statement in your code to avoid the strategy to be calculated on historical data.

            // Only run on real-time data
            if (Historical)
            return;

            Add the statement to the top of OnBarUpdate()
            JasonNinjaTrader Customer Service

            Comment


              #7
              Automating Trading

              Hi Jason

              I run on a SIM 101 account so the demage of submitting a market order opposit the strategy positionis not real. But on a real live account this will mean a real position how does onr cope with that I might loose money on doing so!!!!


              How do I add you suggestion of :

              // Only run on real-time data
              if (Historical)
              return;

              Add the statement to the top of OnBarUpdate()


              trough the strategy wizard since I am not a programmer

              Thank you for your support and answers

              Michael

              Comment


                #8
                Unfortunately it is not possible to add this via the Strategy Wizard.

                Go to Tools-->Edit NinjaScript-->Strategy and double click your strategy to open up the code. Enter the statement at the beginning of the OnBarUpdate()
                JasonNinjaTrader Customer Service

                Comment


                  #9
                  Hi Jason,

                  Thanks but I am not quote sure.

                  Likr this?

                  ///</summary>
                  protectedoverridevoid OnBarUpdate()
                  {

                  // Only run on real-time data
                  if (Historical)
                  return;

                  // Condition set 1
                  if (CrossAbove(EMA(EMA1), EMA(EMA2), 1)
                  && Stochastics(StochasticD, StochasticK,
                  3).D[0] < StochMAX)
                  {


                  Am I missing any : {


                  Best regards

                  Michael

                  Comment


                    #10
                    Change '{' (last one) to '}' and you should be fine. Hit F5 to compile the code and check if it will compile successful.
                    JasonNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by geddyisodin, Yesterday, 05:20 AM
                    8 responses
                    49 views
                    0 likes
                    Last Post geddyisodin  
                    Started by DayTradingDEMON, Today, 09:28 AM
                    3 responses
                    19 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by Stanfillirenfro, Today, 07:23 AM
                    9 responses
                    23 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by George21, Today, 10:07 AM
                    0 responses
                    8 views
                    0 likes
                    Last Post George21  
                    Started by navyguy06, Today, 09:28 AM
                    1 response
                    7 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Working...
                    X