ATR based stop not working

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #231522 quote
    john1977
    Participant
    New

    WHAT APPEARS TO BE THE PROBLEM WITH THIS CODE ? THANKS FOR ANY 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

    #231546 quote
    robertogozzi
    Moderator
    Master

    It seems to be written in another language other than PRT’s at least some parts of it.

    Can you post a link to that code, with some details?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

ATR based stop not working


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
john1977 @john1977 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
1 year, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/15/2024
Status: Active
Attachments: No files
Logo Logo
Loading...