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

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 Mizzouman1, Today, 07:35 AM
        4 responses
        18 views
        0 likes
        Last Post Mizzouman1  
        Started by philmg, Today, 01:17 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by cre8able, Today, 01:01 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by manitshah915, Today, 12:59 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by ursavent, Today, 12:54 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X