ATR Trailing Stop – Simplified Creation Issue

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #169103 quote
    Yantra
    Participant
    Senior

    When I try to use “PRC_ATR Trailing Stop v2.1” as part of a backtest using simplified creation (i.e. Buy/Sell when slow trail crosses under/over price or alternatively under/over fast trail) I receive the following error message:

    “The function “PRC-ATR Trailing stop v2.1″ returns 2 values but your code needs 3”

    I am using PRT v11 on IG. What am I doing wrong I’m wondering? Any light appreciated.

    Thank you.

    #169150 quote
    robertogozzi
    Moderator
    Master

    That happens because the indicator uses DRAWCANDLE to paint empty space in between the two lines.

    If you don’t mind that colouring you can comment out line 62:

    //drawcandle(trail1,trail2,trail1,trail2) coloured(rtrail,gtrail,0,50)bordercolor(0,0,0,0)

    or, if you need it, manually modify the created code, removing the second IGNORED from the variables left to the “=” operator with the CALL:

    indicator1, ignored, ignored = CALL "PRC_ATR Trailing Stop v2.1"(close) //before
    indicator1, ignored = CALL "PRC_ATR Trailing Stop v2.1"(close)          //after
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

ATR Trailing Stop – Simplified Creation Issue


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Yantra @rover220 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
4 years, 9 months ago.

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