Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buy 8 ticks below/above signal

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

    Buy 8 ticks below/above signal

    Hello,

    What line of code I have to add to tell my strategy to EnterLong 10 ticks below this signal?

    if( (macd.Avg[0] < 0) // signal line below zero
    && ((macd[0] > upperBand[0]) && (macd[1] <= upperBand[1]))) // cross up
    {
    EnterLong("MACDBB_LongEntry");

    As it is, my strategy is entering at Market at the opening of the next bar.

    Thanks

    Alan

    #2
    Hello Alan,

    Orders appear on the open of the next bar when Calculate is 'On bar close'.
    https://ninjatrader.com/support/foru...992#post782992

    Are you wanting to use a Market Order?

    Likely you will need two conditions. The first condition checks the proposed criteria and sets a value to a variable as a trigger such as the price. Then a second condition checks this variable and when set will wait until the Close[0] drops the desired amount of ticks below the saved price. When this occurs the second condition will reset the variable and submit the order.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      No, I actually want to buy with LIMIT (not market) order 10 ticks below the signal.

      Comment


        #4
        Hello futuros,

        Then use EnterLongLimit(Close[0] - 8 * TickSize).



        (Optionally, use the overload with isLiveUntilCancelled as true to keep the order alive on new bars without having to resubmit)
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        89 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        135 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        69 views
        0 likes
        Last Post PaulMohn  
        Working...
        X