Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ProfitTarget turns off trend

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

    ProfitTarget turns off trend

    Using the Strategy Wizard, can you tell me how to make an MACrossover make a bool Uptrend=True and a ProfitTarget fill make the same bool Uptrend=false.

    #2
    Hello Kenb2004,

    Welcome to the NinjaTrader forums!

    You can come close to creating this with strategy wizard but not exactly. Setting bools requires working with code. You can use user variables to simulate these.

    See here for a sample on user variables in the strategy wizard.

    You wouldn't be able to set a user variable when profit target fills, but you could use market position to check when flat.

    See here for help with checking position in the strategy wizard.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Trade once

      If an MACrossover makes a condion true, how can I enter the market, with a ProfitTarget and a StopLoss and make that original condition false? So after reaching the ProfitTarget or StopLoss it doesn't make another trade from the original true condition.
      Last edited by kenb2004; 08-27-2010, 01:56 PM. Reason: Remove Quote

      Comment


        #4
        In your condition just add a bool variable check along with the cross over check. When it trades then set the bool to false so it would not trade ever again.

        Code:
        if (someBool == true && CrossAbove(...))
        {
              EnterLong();
              ... anything else you want it to do....
              someBool = false;
        }
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Can this be done with the Strategy Wizard? In the User Defined Inputs would you create "somebool"=true and then make "somebool"=false with the entry action? Or would that keep the entry action from taking place?

          Comment


            #6
            kenb2004,

            To do this in the Strategy Wizard you would want to use one of prebuilt variables and use numbers instead. You can use 0 and 1 to represent trade and don't trade.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, Yesterday, 10:06 AM
            0 responses
            20 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            18 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            14 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            9 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            40 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X