How to make dynamic stoploss?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #16509 quote
    strykerstryker
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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
ProRealCode ProRealCode
Loading...