Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tradestation Strategy

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

    Tradestation Strategy

    Hi,

    I have a strategy running on my Tradestation platform, and it has money management rules, when i test on the Ninja demo automated trading platform, the strategy sends a signal to buy i.e 90 contracts using a leverage of 2:1 based on the last strategy account balance in Tradestation, so in that case the account balance would be 4.5 mio, but in Ninja account balance i have only 1 mio at the same time, so what can i do to calculate the moneymanegement rule (2:1) described in my strategy when the tradestation signal entry order turns on, based on Ninja last account balance, and not on the Tradestation Strategy account balance.

    Best Regards

    JP

    #2
    imported post

    JP,

    Are you using the DLL interface or Email interface?

    Ray
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      The email one.......

      Comment


        #4
        imported post

        Its not possible to determine account balance from NT using the email interface. The logic for determining position size must reside in your EL script.

        Ray
        RayNinjaTrader Customer Service

        Comment


          #5
          imported post

          So i have to rewrite the hole strategy code in NT???

          Comment


            #6
            imported post

            That would be a valid approach.

            Ray
            RayNinjaTrader Customer Service

            Comment


              #7
              imported post

              Thanks for your response but i don't want to waste time trying to make it work (connection), i prefer use it in finding another strategies.....is there any other way to do it fast and simple??

              Comment


                #8
                imported post

                Add an input to your TS strategy that represents account value, set this value when you run your strategy, then in your strategy, add some logic to update this value based on closed trades and then use this value to calcualte position size.


                Ray
                RayNinjaTrader Customer Service

                Comment


                  #9
                  imported post

                  Thanks i'll try that but it's not the best solution, let's see if it works for a 24 hour active trading strategy.


                  Comment


                    #10
                    imported post

                    Ray,

                    It works but has too many limitations......What i want to do is to run a strategy that trades three different pairs,two ofthem uses the 30% of the account balance each one, and the other one uses the 40% of the acc balance. It's an active strategy that runs 24 hours (nochance to being updating manually when it must ).

                    What i need is that some input or whatever in the respective strategies in Tradestation, recognizes the real time account balance that i have in Ninja, and therefore when the strategylaunches a signal, it allocates the amount to be entered into the market for that position, accordingtoa defined percent based on my last account balance.

                    Is that possible??....

                    I'll really appreciate if you can help me with this.

                    Best Regards

                    JP




                    Comment


                      #11
                      imported post

                      Hi JP,

                      Unfortunately this is not possible at this time. I will add this as a request for future enhancement consideration.

                      Ray
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        Did the ability to place trades by percentage of account balance get added to Strategy Wizard?

                        Is there some way of achieving this now?

                        Comment


                          #13
                          Hello James Beale,

                          While it is possible to for the quantity to be set to a manually entered account size, this will be the full account size and not a percentage.

                          You could choose to use an account size that is 30% of the full account size and this may accomplish what you would like.

                          To use an account size, in the strategy parameters set 'Set order quantity' to 'by account size', then set a value for Account size.

                          Or you can use unsupported methods to return the account balance, multiply this by .30, and then calculate the number of contracts from this from within your script.

                          Doing this is unsupported, but below is a tip on how to find the account balance.
                          Code:
                          foreach (Account acct in Cbi.Globals.Accounts)
                          {
                          if (acct.Positions != null)
                          {
                          Print(acct.GetAccountValue(AccountItem.CashValue, Currency.UsDollar);
                          }
                          }
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Thank you for the reply.

                            I really need to devise a method of doing this in strategy wizard, and - unless I've misunderstood - I think what you suggested would involve unlocking the code, and trying to figure things out from there. This isn't something I'm comfortable with as my coding isn't up to the job. This is quite a fundamental thing for any trader, and I'm not sure why it isn't obvious.

                            I see Condition Builder within Strategy Wizard does have Strategy "Realized PnL" value entries built in, but none for "Current Balance".

                            I thought it would be a simple matter, therefore, of creating an EnterLong action, with the following in the Quantity field:
                            (n+(Performance.AllTrades.TradesPerformance.Curren cy.CumProfit))*y
                            where n=my initial account balance, and y=0.03 (or whatever percentage). However, the strategy builder doesn't seem to like this, and the value simply becomes "0".

                            Is there really no way with Strategy Builder to construct trade entry using y% of my account's balance?

                            Comment


                              #15
                              Hi James Beale,

                              That is correct. It would not be possible to find your account balance using the Strategy Wizard.

                              Also it would not be possible to do this kind of math with the Strategy Wizard.
                              Chelsea B.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by jcbinks, Today, 03:59 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post jcbinks
                              by jcbinks
                               
                              Started by mrvidi, Today, 03:36 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post mrvidi
                              by mrvidi
                               
                              Started by GLFX005, Today, 03:03 AM
                              0 responses
                              15 views
                              0 likes
                              Last Post GLFX005
                              by GLFX005
                               
                              Started by ラリー, Today, 02:17 AM
                              0 responses
                              18 views
                              0 likes
                              Last Post ラリー  
                              Started by GuzmanCraige, Today, 12:21 AM
                              0 responses
                              13 views
                              0 likes
                              Last Post GuzmanCraige  
                              Working...
                              X