Absolute Stop Loss

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43302 quote
    mikenewmikenew
    Participant
    Junior

    It looks to me like all the stop loss functions are relative to TradePrice.

    Is there a way or a code pattern that I can set an absolute stop loss?

    Ideally something like

    SET STOP LOSS sma(35)

    or

    SET STOP LOSS 18364.4

     

    I’ve tried     SET STOP LOSS ( TradePrice – sma(35) )

     

    but doesn’t work when the stop level is in profit.

    #43325 quote
    DespairDespair
    Blocked
    Master
    sl=sma(35)
    if longonmarket then
      sell at sl stop
    elsif shortonmarket then
      exitshort at sl stop
    endif
    

    Here you go.

    #43329 quote
    NicolasNicolas
    Keymaster
    Legend

    A complete tutorial to create a stoploss with indicators

Viewing 3 posts - 1 through 3 (of 3 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

Absolute Stop Loss


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
mikenew @mikenew Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by NicolasNicolas
9 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/17/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...