Announcement

Collapse
No announcement yet.

Stop Loss and Take Profit missing in Strategy

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

  • Stop Loss and Take Profit missing in Strategy

    Hi,
    Since my formula runs once in time period, defined by Back testing bar rate, i can't check position entry/exit condition during that period (say, an hour resolution). I didn't find standard 'Take profit" or "Stop loss" parameters that I can specify within doLong() or doShort(), that will close position automatically and record a realistic price.
    Since real-life brokers must provide such functionality, how can I achieve the same with Strategy object? Otherwise, my backtesting result either must run only in per-tick resolution or will provide highly unrealistic results (depending on market volatility and bar resolution).
    Am I missing something in Strategy tutorial?

  • #2
    Re: Stop Loss and Take Profit missing in Strategy

    Michaelb
    The doLong() and doShort() methods of the Strategy Object do not include the provision to set stops and/or profit targets. You need to create the logic for those yourself.
    You can find examples of how to do either in the Back Testing Tutorial 2 How to Close Positions with Profit Targets and Stops which is available in the Help Guides and Tutorials folder of the EFS KnowledgeBase
    Alex


    Originally posted by michaelb
    Hi,
    Since my formula runs once in time period, defined by Back testing bar rate, i can't check position entry/exit condition during that period (say, an hour resolution). I didn't find standard 'Take profit" or "Stop loss" parameters that I can specify within doLong() or doShort(), that will close position automatically and record a realistic price.
    Since real-life brokers must provide such functionality, how can I achieve the same with Strategy object? Otherwise, my backtesting result either must run only in per-tick resolution or will provide highly unrealistic results (depending on market volatility and bar resolution).
    Am I missing something in Strategy tutorial?

    Comment


    • #3
      Alex, thanks for your reply.I've read the tutorial you're referencing- I just wanted to be sure that it's the only way.

      Best regards,
      Michael

      Comment

      Working...
      X