Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Default Account while Running a NinjaScript Strategy from a Chart

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

    Default Account while Running a NinjaScript Strategy from a Chart

    Hello,

    I am running a NinjaScript from a chart window. Most of the properties are able to be set in the NinjaScript (Parameters, Order Handling etc.).

    Can I define an account other than Sim101 as the default account for automated trading (not ATI)? Anywhere in the options menu or in the NinjaScript (maybe in the initialize()-section of the script)?

    Thanks a lot.

    Joerg
    Last edited by Joerg; 08-27-2009, 03:30 AM.

    #2
    Joerg, unfortunately this is not supported with NinjaTrader 6.5 - but you can try for example this at the OnBarUpdate start for never trading in Sim and then go from there, account name is a string -

    Code:
     
    if (AccountName == "Sim101") return;
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,

      does this mean it will be possible in version 7? I really need the possibility to start NinjaSkripts running on a live account without manual action.

      I tried to do it in the code like it´s possible for "EntriesPerDirection" or other settings but AccountName seems to be readonly.

      Code:
       
      #region Variables
      string accountName = "Tim101";
       
      #region Properties
      [Description("Account used for Trading")]
      [Category("General")]
      public string AccountName 
      {
      get { return accountName; } 
      set { base.AccountName = accountName; } }
      Why not giving the user this possibility? If one is able to do so he typically knows what he does or at least what´s the risk of that?

      Thanks.

      Kind regards,

      Joerg
      Last edited by Joerg; 08-28-2009, 06:10 AM.

      Comment


        #4
        You cannot change the account a strategy is running on while already running. This will not change in NT7.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Is it possible to use "AccountName" in an indicator? I always get the message -"AccountName" does not exist in the current context-.
          Maybe I missed a using statement?

          Thanks a lot.

          Joerg


          Originally posted by NinjaTrader_Bertrand View Post
          Joerg, unfortunately this is not supported with NinjaTrader 6.5 - but you can try for example this at the OnBarUpdate start for never trading in Sim and then go from there, account name is a string -

          Code:
           
          if (AccountName == "Sim101") return;

          Comment


            #6
            Unfortunately this would not work for indicators Joerg.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by Joerg View Post
              Hi Bertrand,

              does this mean it will be possible in version 7? I really need the possibility to start NinjaSkripts running on a live account without manual action.

              I tried to do it in the code like it´s possible for "EntriesPerDirection" or other settings but AccountName seems to be readonly.

              Code:
               
              #region Variables
              string accountName = "Tim101";
               
              #region Properties
              [Description("Account used for Trading")]
              [Category("General")]
              public string AccountName 
              {
              get { return accountName; } 
              set { base.AccountName = accountName; } }
              Why not giving the user this possibility? If one is able to do so he typically knows what he does or at least what´s the risk of that?

              Thanks.

              Kind regards,

              Joerg
              Hi Bertrand,

              I tried this, on NT7, but it shows the wellknown error message after compiling... Would it be possible to ask the system which account it is working on? I would just like to put it in my logfile.

              Thanks,
              Péter

              Comment


                #8
                Welcome to the forums Péter, this will unfortunately not work if you're from an indicator - only the strategy could access the unsupported Account.Name
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by selu72, Today, 02:01 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Started by WHICKED, Today, 02:02 PM
                2 responses
                11 views
                0 likes
                Last Post WHICKED
                by WHICKED
                 
                Started by f.saeidi, Today, 12:14 PM
                8 responses
                21 views
                0 likes
                Last Post f.saeidi  
                Started by Mikey_, 03-23-2024, 05:59 PM
                3 responses
                51 views
                0 likes
                Last Post Sam2515
                by Sam2515
                 
                Started by Russ Moreland, Today, 12:54 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Erick  
                Working...
                X