Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit target reached, how to stop strategy?

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

    Profit target reached, how to stop strategy?

    I am running a simple automated system on the eminis with a single indicator, built with the Strategy Wizard. My question concerns profit targets. My goal is for the system to reach a given profit target and then to stop trading for the day once it has been reached even if the original entry condition is still true on the following bars. My problem is that I can't get it to stop entering trades even after the target is reached. I have tried to correct this using "realized PnL" (i.e. don't enter if the PnL for the day has hit $700) but it doesn't backtest properly with the Strategy Optimizer. Is there any other way to accomplish this or am I using "realized PnL" incorrectly?

    #2
    I can't think of an approach in the wizard that could be done easily. Of course this can be done programattically.

    Here is a reference sample for this - http://www.ninjatrader-support.com/v...ead.php?t=4084
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks, I've output the code from the Strategy Wizard and added your suggested lines. However, when I go to compile, I'm getting CSO103 errors for "priorTradesCumProfit" and "priorTradesCount":

      "The name "priorTradesCount" does not exist in the current context."

      Any suggestions (admittedly I don't know much about this area, my first foray out of the safety of the Wizard)? Thanks very much.

      Comment


        #4
        Likely means the variable is not declared or something like that.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by gm7_forum, Today, 05:51 PM
        0 responses
        1 view
        0 likes
        Last Post gm7_forum  
        Started by cre8able, Today, 03:20 PM
        1 response
        9 views
        0 likes
        Last Post cre8able  
        Started by fiddich, Today, 05:25 PM
        0 responses
        3 views
        0 likes
        Last Post fiddich
        by fiddich
         
        Started by gemify, 11-11-2022, 11:52 AM
        6 responses
        804 views
        2 likes
        Last Post ultls
        by ultls
         
        Started by ScottWalsh, Today, 04:52 PM
        0 responses
        4 views
        0 likes
        Last Post ScottWalsh  
        Working...
        X