Backtest Long / Short Dependent Stop Loss

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #157791 quote
    Roq
    Participant
    Junior

    Hi all & happy New Year!

    I know how to set different types of stop losses but what I want to do is to set conditional stop losses depending on whether the position is long or short.

    Sadly LONGONMARKET / SHORTONMARKET only seems to work in connection with opening positions not as part of say “IF LONGONMARKET SET” SL.

    Please let me know if a L/S dependent SL is possible.

    Many thanks

    Roq

    #157796 quote
    robertogozzi
    Moderator
    Master

    You can use conditional SL’s:

    IF LongOnMarket THEN
       SET STOP pLOSS 50
    ELSIF ShortOnMarket THEN
       SET STOP pLOSS 40
    ENDIF

    Bear in mind that ProOrder detects the OnMarket status when the entry candle closes, so you will remain On Market, for a whole candle withouit a stop loss.

    I suggest that you use:

    IF MyLongConditions THEN
       BUY 1 Contract AT Market
       SET STOP pLOSS 50
    ELSIF MyShortConditions THEN
       SELLSHORT 1 Contract AT Market
       SET STOP pLOSS 40
    ENDIF

    Moreover, the last SET STOP pLOSS executed overrides any prior setting for all open positions.

    Nicolas and Roq thanked this post
    #157855 quote
    Roq
    Participant
    Junior

    Thank you so much Roberto!

    #163378 quote
    Guyber
    Participant
    Junior

    Merci pour votre solution.

    Thanks for your solution.

    #163379 quote
    Vonasi
    Moderator
    Master

    Guyber – Welcome to the forums.

    Please follow the forum rules when posting in the forums.

    • Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Backtest Long / Short Dependent Stop Loss


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Roq @roq Participant
Summary

This topic contains 4 replies,
has 4 voices, and was last updated by Vonasi
4 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/14/2021
Status: Active
Attachments: No files
Logo Logo
Loading...