Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need help in setting entry/stop and target levels

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

    Need help in setting entry/stop and target levels

    Hi,

    I'm relatively new to Ninjatrader and trying to build an automated trading strategy. The issue is that i'm having problems with setting the right entry/stop and target levels for my strategy.

    What i'm trying to achieve:
    • I want to place a pending buy order at the high of the candle (when the conditions are met)
    • Set stop loss to the low of the candle
    • Set target to 2x the risk

    I tried doing the above as below:

    HTML Code:
    EnterLongStopLimit(DefaultQuantity, High[0], Low[0],"Entry")
    In the 'Stops and Target' window I set the following:
    HTML Code:
    SetProfitTarget("Entry", CalculationMode, Percent, 2)
    Errors:
    HTML Code:
    **NT** A Buy order placed at '09-Jul-10 23:00:00' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.
    Could someone please advise on how to fix this?

    #2
    Welcome to our forums here. If you're closing on the High that would be expected to produce an invalid order, as the a LongStop order has be be placed higher than current price (even more important in realtime, as the current bid / ask spread will come into play as well). So perhaps add a tick or two to provide some cushion in this case? For the target you want to input the 2 percent as 0.02 value.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Welcome to our forums here. If you're closing on the High that would be expected to produce an invalid order, as the a LongStop order has be be placed higher than current price (even more important in realtime, as the current bid / ask spread will come into play as well). So perhaps add a tick or two to provide some cushion in this case? For the target you want to input the 2 percent as 0.02 value.
      Thanks. On closer inspection i noticed that the errors came up only for those securities where the next candle opened higher than the previous high.

      But could you suggest how to add a 2 or 3 ticks to previous candle high?

      Also, regarding the percent set up for take profit. Its a bit confusing. The profit target is set to the following:

      Mode: Percent
      Value: 2

      I'm assuming this to be 2%. Or is it 0.02 for value that makes it 2%?

      And finally, could someone point me for more info regarding money management?
      I'm basically trying to build into my strategy to allocate for example 2% towards risk. So for a 10k starting equity, every trade will risk 2%.

      Comment


        #4
        You are correct in understanding, those 2 percent would be presented by a double value of 0.02 in this call.

        For adding ticks to your stop order, you can use multiples of TickSize for example - http://www.ninjatrader.com/support/h...7/ticksize.htm

        As far as dynamic positon sizes go, we would per default have the option implemented to have the strategy calculate those by a set AccountSize - http://www.ninjatrader.com/support/h...ccountsize.htm

        You can of course run custom calculations as well to supply that quantity, in realtime testing it could also pull in account info from your account to consider -

        http://www.ninjatrader.com/support/h...countvalue.htm
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hello again.. In continuation to my previous questions. Can someone assist me on how to set the target price as follows:

          I'm trying to do the following:

          When Bid Price = 3 * (High[1] - Low[0])
          Exit Long position
          ----------------------

          EDIT: I went into the unlock mode and looking at the strategy via code.

          So I'm entering long when:

          HTML Code:
          EnterLongStopLimit(DefaultQuantity, High[0], Low[1], "MySignal");
          and i'd like to exit when its 3 times the risk

          HTML Code:
          SetProfitTarget("MySignal", CalculationMode.Ticks, 3*(High[0]-Low[1]));
          But not much of luck
          Last edited by ragnor; 04-01-2014, 10:08 AM.

          Comment


            #6
            ragnor, where do you have that SetProfitTarget call placed? In the OnBarUpdate()? The value you supply in ticks would be literally interpreted this way, it would not be price based for example (which is a mode for SetProfitTarget as well).
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              ragnor, where do you have that SetProfitTarget call placed? In the OnBarUpdate()? The value you supply in ticks would be literally interpreted this way, it would not be price based for example (which is a mode for SetProfitTarget as well).
              Its set on the initialize(), because I assume the TP = Static (based on the help files for NT)

              HTML Code:
              protected override void Initialize()
                      {
                          SetProfitTarget("MySignal", CalculationMode.Ticks, 3*(High[0]-Low[1]));
                          CalculateOnBarClose = true;
                      }

              Comment


                #8
                ragnor, you will need to work that directly in OnBarUpdate() since it would not be static (like 10 ticks for example always) but update depending on which bars are taken into consideration as you process the chart data (historical and realtime).
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by SuneSorgenfrei, Today, 04:47 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_ChrisSch  
                Started by lju45, Today, 04:54 AM
                0 responses
                6 views
                0 likes
                Last Post lju45
                by lju45
                 
                Started by lakman184, Today, 03:09 AM
                4 responses
                14 views
                0 likes
                Last Post NinjaTrader_Jason  
                Started by romintrio, Today, 02:16 AM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_Jason  
                Started by SCC74, Today, 01:32 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Jason  
                Working...
                X