How to make dynamic stoploss?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #16509 quote
    stryker
    Participant
    New

    Hi I have the following simple code but it doesn’t work as I expect in the backtest.

    In essence I would like to move my stop in line with favourable market moves but in step fashion rather than trailing.
    eg long position goes 4 ticks on side so I move my stop up 2 ticks.

    Does anyone know the best way to achieve this please?

    IF condition1 THEN
    BUY 1 PERPOINT AT MARKET NextBarOpen
    ENDIF
    
    SET STOP pLOSS 6
    
    IF LONGONMARKET AND HIGH-TRADEPRICE >= 4 THEN
    SET STOP pLOSS 4
    ENDIF
    
    IF LONGONMARKET AND HIGH-TRADEPRICE >= 7 THEN
    SET STOP pLOSS 2
    ENDIF
    
    IF LONGONMARKET AND HIGH-TRADEPRICE >= 9 THEN
    SET STOP pLOSS 1
    ENDIF
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

How to make dynamic stoploss?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
stryker @stryker Participant
Summary

This topic contains 1 voice and has 0 replies.

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