ATR STOP NOT WORKING

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #231523 quote
    john1977john1977
    Participant
    New

    WHAT APPEARS TO BE WRONG WITH THIS CODE NOT WORKING? THANKS FOR THE HELP
    // Calculate the Average True Range (ATR)
    ATR_Length = 14
    ATR = AverageTrueRange(ATR_Length)

    indicator1 = supertrend[Multiplier, Length]

    if close crosses over indicator1 then
    buy at market
    endif

    if close crosses under indicator1 then
    sellshort at market
    endif

    set target pprofit 50
    set target pprofit 12 // Profit target of 12 points

    // Set stop loss at 1.5 times ATR
    ATR_Value = valuewhen(1, ATR)
    SET STOP PTRAILING TRAILING Ptrailing ATR_Value * 1.5

    #231535 quote
    JSJS
    Participant
    Master
    Hi,

    ATR-Length => ATRLength

    Buy at Market => Buy x contract at Market

    SellShort at Market => SellShort x contract at Market

    ATRValue=valuewhen(1,ATR) => this is no PRT code…???

    SET STOP PTRAILING TRAILING Ptrailing ATR_Value * 1.5 => Set Stop PTrailing x

    (x = atr * 1.5)

    #231536 quote
    JSJS
    Participant
    Master
    ATR = AverageTrueRange(ATR_Length) => ATR=AverageTrueRange[ATRLength](Close)
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

ATR STOP NOT WORKING


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
john1977 @john1977 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by JSJS
2 years, 5 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 04/15/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...