Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Setting Stop Targets

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

    Setting Stop Targets

    Hello,

    What is the difference between CalculationMode.Price and CalculationMode.Currency?
    What is the preferred way to set a stop and profit target using these calculation modes?
    Last edited by jflaggs; 06-23-2017, 01:19 AM. Reason: Too broad

    #2
    Hello jflaggs,

    Thanks for writing in to our Support team.

    The price calculation mode will calculate your stop loss and profit target values as absolute price values, while the currency calculation mode will calculate your stop loss and profit target values as an amount in US dollars per tick value for the order quantity used away from the average entry price.

    For example, when using the price calculation mode on the ES instrument, you will need to submit your profit target value as 2441.00 - the actual price that you would like the stop/profit target to be placed at, not at an offset from the average entry price.

    When using Currency, your stop loss/profit target values will be placed x amount of US dollars away from the average entry price - so if you submit your profit target value as 400, this will place your profit target at the price where you would reach $400 of profit.

    Many of our clients use the tick parameter type/calculation mode, as this makes it easier to apply the ATM strategy to other instruments without having to modify the parameters for that particular instrument.

    You can find more information about the different parameter types used in ATM strategies here:
    http://ninjatrader.com/support/helpG...ndTargetValues

    Please let me know if I may be of any further assistance.
    Alan S.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the link. that explains why my stop loss and profit target were so out of wack. It would be helpful if this information were posted under Strategy --> SetStopLoss/SetProfitTarget or CalculationMode (https://ninjatrader.com/support/help...?calculate.htm) since I wouldn't normally be looking at ATM strategy information.

      In terms of strategy development in NinjaScript (not ATM), what is the recommended or preferred CalculationMode to use for maximum robustness/portability across markets (i.e. stocks, forex, etc).

      I have seen somewhere that there are issues using ticks for stop values. Was this a bug in NT7 that has been resolved?

      Comment


        #4
        Hello jflaggs,

        Thanks for your reply.

        I will be submitting a feature request to our development team to include a link to the explanation of the different parameter types in those NinjaScript language reference sections that you pointed out.

        The Tick calculation mode would be the most generally applicable across markets - however keep in mind that when working in the Forex market you must use pips instead of ticks which essentially measure the same thing but pips is specific to Forex.

        We currently do not have widespread reports of any issues regarding using the tick calculation mode to calculate stop loss values.

        Please let me know if I may be of any further assistance.
        Alan S.NinjaTrader Customer Service

        Comment


          #5
          Thank you Alan! Great information.

          Comment


            #6
            Hello jflaggs,

            Thanks for your suggestion to improve our product - it is being tracked with unique tracking ID SFT-2406.

            Please let me know if I may be of any further assistance.
            Alan S.NinjaTrader Customer Service

            Comment


              #7
              I am sending orders from Tradestation to Ninjatrader. It seems like that NT doesn't support stopmar****rder. why?

              If I create a ATMStrategyTemplate on NT and call it from Tradestation side, how can set the stop price or target price as a variable instead a fixed number?

              Thanks.

              ccl3093
              Last edited by ccl3093; 06-28-2017, 10:43 PM.

              Comment


                #8
                Hello ccl3093,

                Thanks for writing in.

                The NinjaTrader platform does support stop market orders. If you are using the Automated Trading Interface with TradeStation, you can read more about stop order handling here:
                https://ninjatrader.com/support/helpGuides/nt8/en-us/stop_order_handling.htm


                It would not be possible via the ATI to set your stop loss/profit target values as variables instead of fixed numbers, you would have to create a custom strategy to achieve this behavior. It is also important to note that you must use order instruction files or the DLL interface in order to submit orders from TradeStation to NinjaTrader using a NinjaTrader ATm strategy template - the email interface will not be able to set the ATM strategy template name. You can use ATM strategy templates with the DLL interface by calling the Command function, and you can find more information about the functions available here:
                http://ninjatrader.com/support/helpG.../functions.htm

                You can find more information about how to work with the ATI in our help guide here:
                http://ninjatrader.com/support/helpG...terface_at.htm

                Please let me know if I may be of any further assistance.
                Alan S.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you Alan for a prompt response.

                  1). I am using NT7, and NTDirect.dll to send order from TS to NT. There is a function of NTStopLimit, but no NTStopMarket under NT7. The NTStopMarket is what I am looking. Is it possible for me to send a Stopmarket order to NT under NT7.0 using code only and without any settings on NT side? If yes, do you have an example code?
                  2). If I use NT8, I am still looking for a proach using code only TS side with settings on NT side.

                  NT7 as a simulation engine is great, and much better than TS.

                  Thank you very much again.

                  ccl3093

                  Comment


                    #10
                    Hello ccl3093,

                    Thanks for your reply.

                    The NTBuyStop() and NTSellStop() functions will submit stop market orders in NinjaTrader 7:

                    int NTBuyStop(string orderId, int quantity, double stopPrice)

                    int NTSellStop(string orderId, int quantity, double stopPrice)

                    In NinjaTrader 8, some of these easy language functions were not implemented so you would have to use the Command() function instead:

                    int Command(string command, string account, string instrument, string action, int quantity, string orderType, double limitPrice, double stopPrice,
                    string timeInForce, string oco, string orderId, string strategy, string strategyId)

                    You can find more information on the supported functions for NinjaTrader 8 here:
                    http://ninjatrader.com/support/helpG.../functions.htm

                    You can find information on the supported functions in NinjaTrader 7 here:
                    http://ninjatrader.com/support/helpG...functions2.htm

                    Please let me know if I may be of any further assistance.
                    Alan S.NinjaTrader Customer Service

                    Comment


                      #11
                      I am so sorry for overlooking those functions.

                      Thank you very much for help.

                      ccl3093

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by GLFX005, Today, 03:23 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post GLFX005
                      by GLFX005
                       
                      Started by XXtrader, Yesterday, 11:30 PM
                      2 responses
                      11 views
                      0 likes
                      Last Post XXtrader  
                      Started by Waxavi, Today, 02:10 AM
                      0 responses
                      6 views
                      0 likes
                      Last Post Waxavi
                      by Waxavi
                       
                      Started by TradeForge, Today, 02:09 AM
                      0 responses
                      12 views
                      0 likes
                      Last Post TradeForge  
                      Started by Waxavi, Today, 02:00 AM
                      0 responses
                      2 views
                      0 likes
                      Last Post Waxavi
                      by Waxavi
                       
                      Working...
                      X