use of GRAPHONPRICE with a STOP %TRAILING

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #243068 quote
    oliTRoliTR
    Participant
    Average

    Hello,

    is it possible to use GRAPHONPRICE with instruction such as  a STOP %TRAILING ?

    Thanks

    #243073 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Hello. You should create a trail stop variable and from there you could even play with the transparency so that it only draws when you are inside the operation. Here is an example

    sma=average[50,0](close)
    // This will control the STOP LOSS transparency
    if not onmarket then
    transparency=0 //transparency
    else
    transparency=255
    endif
    // Long Trades
    if not onmarket and close crosses over sma then
    stopLoss=close-2*averagetruerange[14](close)
    targetProf=close+2*(-stopLoss+close)
    buy 1 contracts at market
    endif
    
    set stop price stopLoss
    set target price targetProf
    
    graphonprice stopLoss coloured(255,0,0,transparency)
    fifi743 and oliTR thanked this post
Viewing 2 posts - 1 through 2 (of 2 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

use of GRAPHONPRICE with a STOP %TRAILING


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
oliTR @olitr Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván GonzálezIván González
1 year, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/24/2025
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...