Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting SMA as the stop target

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

    Setting SMA as the stop target

    Hello,
    I am new to NinjaTrader and to this forum. So far I have really enjoyed using and learning about the tool and have been trying to create a simple strategy.

    I trade ES and if SMA(13) crosses above SMA(75), I get an entry signal.

    My challenge is I also want to submit a stop loss order equal to SMA(75) - 8 ticks based on my entry bar. And I do not want this to change as my trade progresses. In short I want to use a fixed stop loss and do not want it to trail with the trade.

    I have been looking into the manual but was not so successful in figuring this one out.

    I'd greatly appreciate any help. Thanks.

    #2
    Originally posted by pandyav View Post
    Hello,
    I am new to NinjaTrader and to this forum. So far I have really enjoyed using and learning about the tool and have been trying to create a simple strategy.

    I trade ES and if SMA(13) crosses above SMA(75), I get an entry signal.

    My challenge is I also want to submit a stop loss order equal to SMA(75) - 8 ticks based on my entry bar. And I do not want this to change as my trade progresses. In short I want to use a fixed stop loss and do not want it to trail with the trade.

    I have been looking into the manual but was not so successful in figuring this one out.

    I'd greatly appreciate any help. Thanks.
    Here is some pseudocode.
    Code:
    if (EntryConditionsMet)
    {
    SetStopLoss(CalculationMode.Price, SMA(75)[0] - 8 * TickSize);
    //Entry Order goes here
    }

    Comment


      #3
      Thank you very much for a quick reply.

      Similar question: As described above the strategy generates an entry signal based on Xover of SMA(13) and SMA(75).

      The challenge is that I want to place entry price 2 ticks above the high of entry bar. In many cases this does not happens immediately after the entry bar and can take 4 to 5 bars before the prices move higher enough.

      But as this does not happen on the immediate bar, I lose the trading opportunity when the price eventually moves higher and hits my entry target.

      Is there a way around the problem here? Eg. as long as the ES moves 2 ticks higher in next n number of bars I'll still be able to go long even though the cross over happened a few bars ago.

      Once again, appreciate any help you can provide.

      Comment


        #4
        Originally posted by pandyav View Post
        Thank you very much for a quick reply.

        Similar question: As described above the strategy generates an entry signal based on Xover of SMA(13) and SMA(75).

        The challenge is that I want to place entry price 2 ticks above the high of entry bar. In many cases this does not happens immediately after the entry bar and can take 4 to 5 bars before the prices move higher enough.

        But as this does not happen on the immediate bar, I lose the trading opportunity when the price eventually moves higher and hits my entry target.

        Is there a way around the problem here? Eg. as long as the ES moves 2 ticks higher in next n number of bars I'll still be able to go long even though the cross over happened a few bars ago.

        Once again, appreciate any help you can provide.
        Take a look at the liveUntilCancelled parameter override on EntryOrders.

        refL: http://www.ninjatrader.com/support/h...rlonglimit.htm

        Comment


          #5
          So does this mean that in NT the entry orders are alive for one bar only. After that they get canceled?
          In this case after the crossover if the price does not get higher by 2 ticks, the order will be canceled automatically?

          Sorry if I am missing something here as I am new to the platform. Thanks.

          Comment


            #6
            Originally posted by pandyav View Post
            So does this mean that in NT the entry orders are alive for one bar only. After that they get canceled?
            In this case after the crossover if the price does not get higher by 2 ticks, the order will be canceled automatically?

            Sorry if I am missing something here as I am new to the platform. Thanks.
            To put it as simply as possible, the answer to your question is: "yes".

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by WiseAmo, Today, 04:34 PM
            1 response
            10 views
            0 likes
            Last Post aseef
            by aseef
             
            Started by kiddads, Today, 05:23 PM
            0 responses
            2 views
            0 likes
            Last Post kiddads
            by kiddads
             
            Started by gtheaded, Today, 04:38 PM
            0 responses
            10 views
            0 likes
            Last Post gtheaded  
            Started by trader252, Today, 04:34 PM
            0 responses
            14 views
            0 likes
            Last Post trader252  
            Started by Don22Trader1, Today, 04:20 PM
            0 responses
            9 views
            0 likes
            Last Post Don22Trader1  
            Working...
            X