Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to set total profit/loss targets for strategy?

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

    How to set total profit/loss targets for strategy?

    I would like to set a total profit target and loss target for an automated strategy. Does the "Wizard>Strategy Action> profit target total position or stop loss total position" calculate based on the total trades since strategy is enabled? If so, does it reset once the strategy is disabled/enabled?

    #2
    Hello,

    Thanks for the forum post.

    It works off the QTY used in your EnterLong() or EnterShort() entry commands and also what ends up getting filled(Will protect a half filled position once it fills). When you are turning on a strategy it uses the strategy historical position from a fresh start to isolate where it stops should be and if they are already there it will overwrite the stops that are currently there if you just do a basic disable->enable action as there is some strategy persistence from disable state to enable state.

    The biggest thing is making sure your strategy and accounta re in sync when you enable the strategy.

    Strategy Position vs. Account Position:

    Comment


      #3
      Thanks Brett, but I think I misunderstood what 'total position' was referring to. What I really want to do is put a strategy trading session stop loss and profit target in effect. * And before I go further, I want to clarify what I mean by "trading session". I don't mean daily limits. I might want to have a strategy run in the morning, turn it off during lunch and then start it again in the afternoon. That would be two "strategy trading sessions'. So I don't want the profit target/stop loss tied to the daily P&L for the account. I want to keep a sub-P&L that tracks the actual trades from when the strategy is enabled to current live trading of a strategy each time.

      Attached is an example of what I was thinking of using the Wizard.
      Click image for larger version

Name:	DailyPLtrigger.PNG
Views:	1
Size:	17.9 KB
ID:	865383

      Here I am attempting to check the cumulative profits of all trades since the strategy was started and check to see if the PT has been met or exceeded. In this case, if true, I would change the Variable0 which would stop the strategy from trading.

      Same scenario for the stoploss. It would check for a total loss and if Cumulative p&l was <= some amount, it would change the Variable0 which would stop the strategy from trading.

      If my logic makes sense, I also wanted check to see if I did it correctly. I have the cumulative trades set to currency and compare it against the integer 500. Will this trigger as true if cumulative profits are $500+ the way it is written? If so, can I simply insert -300 for purposes of checking a $300 stop trading loss limit?

      Finally, as you see I have inserted a condition that I would like this calculation to occur each time the strategy position went flat. I did this because I don't want this to act as a stop per se and interfere with the strategy trade management. However, I see a problem if the cumulative limit is met in either direction, but the trade is reversed by a trade signal in the opposite direction instead of closed due to trade management.

      Thanks.
      Last edited by billr; 05-31-2012, 04:02 PM.

      Comment


        #4
        Hello,

        Yes you should not run into any issue doing what you describe. You may also want to consider not disabling the strategy and leaving it enabled but just putting a time filter in.



        -Brett

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by alifarahani, Today, 09:40 AM
        6 responses
        31 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        13 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Waxavi, Today, 02:00 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X