Average True Range indicator as stop

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #142435 quote
    steynpj
    Participant
    Average

    I want to use multiples of Average True Range as a stop loss and limit

    I tried below, with ‘D’ variable for ATR periods, and’E’ & ‘F’ variables for multiplication of ATR, not working.

    // Stops and targets
    SET STOP pLOSS (AVERAGETRUERANGE[D](CLOSE))*E
    SET TARGET pPROFIT (AVERAGETRUERANGE[D](CLOSE))*F

     

    Any ideas?

    Thank you.

    MODERATORS EDIT: Code tidied up. Please always use the ‘Insert PRT Code’ button when posting code.

    #142436 quote
    robertogozzi
    Moderator
    Master

    ATR does not return pips, so you should remove “p” and use just LOSS and PROFIT.

    #142508 quote
    Nicolas
    Keymaster
    Master

    Bear in mind that using these function in the code will continuously adapt the Takeprofit and Stoploss on each variation of the ATR. You should enclose these instructions into the condition that trigger the order.

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

Average True Range indicator as stop


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
steynpj @steynpj Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/24/2020
Status: Active
Attachments: No files
Logo Logo
Loading...