Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to configure the profit target logic in a strategy

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

    How to configure the profit target logic in a strategy

    I'm trying to replace the profit target with another exit condition under "Conditions and actions"

    What I've done is instead of setting the profit target on 20 pips, I've made a condition that exit the long position (I only allow one to run in a time) when the unrealized PnL is equal 20 pips or more.

    While it works, it doesn't work same as the ordinary Profit target doesn't return the same results, and I'm not sure why.

    Can anyone help with this pls?

    Thanks!
    Last edited by bestmethod; 07-22-2020, 05:19 PM.

    #2
    Hello bestmethod,

    Thanks for your post.

    What Calculation mode does the strategy use? (Calculate.OnBarClose, Calculate.OnPriceChange, to Calculate.OnEachTick)

    Where are you observing this? On a live data chart, in market replay, or in the strategy analyzer.

    What specific exit order are you using?

    Comment


      #3
      Hello Paul,

      Thanks for your response, its calculated "Calculate.OnPriceChange" I'm observing this in the strategy analyzer, and I'm using "ExitLong(Default Quantity)"

      Appreciate your support
      Thanks

      Comment


        #4
        Hello bestmethod,

        Thanks for your reply.

        The Calculate mode of OnPriceChange in the strategy analyzer will actually be run as Calculate.OnBarClose (unless you enable tick replay and have the supporting tick data for the analysis period). The reason it runs as Calculate.OnBarClose is because the historical data does not contain all of the ticks that made the bar which means your strategy is called once per bar. In the case of your exit condition, once the exit decision is made by your strategy, the exit order (market type) can only be filled on the next bar which could be well above or below the 20 ticks.

        The SetProfitTarget() uses a limit order so it fills at that price as long as price goes through that level.

        A more accurate comparison could be made by using Playback with market replay data as this provides all of the ticks that build the bar and your strategy can run with Calculate.OnPriceChange.

        Comment


          #5
          Hello Paul,
          But if i use SetProfitTarget() it will desactive my breakeven logic in my strategy. Do you have any sample of how configure the profit logic?

          Thanks

          Comment


            #6
            Hello Santillana1971,

            Thanks for your post.

            I do not have any examples to provide.

            If you use SetStopLoss() as the stop order for the breakeven, you would be able to use the SetProfitTarget().

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            50 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            126 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            69 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            42 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X