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 Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            666 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            377 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            110 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            575 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            580 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X