Range average, Big candle

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #213757 quote
    ZeroCafeine
    Participant
    Senior

    Hi everyone,

    I’m not an ATR specialist, how do I calculate if my candle is X times bigger than the average of the last 10 , I tryed this code but I get an error,

    The idea is to detect an abnormally large candle

    //MyATR = TR(Close)
    
    //MyATRAverage = Average(10)[MyATR]
    
    //Return MyATR AS "MyATR", MyATRAverage AS "ATR Average"
    
    MyRange = High - Low
    MyRangeAverage = Average(20)[MyRange]
    
    Return MyRange AS "MyRange", MyRangeAverage AS "MyRangeAverage"

    Best Reguards,
    ZeroCafeine

    Capture-decran-2023-04-26-a-08.53.08.png Capture-decran-2023-04-26-a-08.53.08.png
    #213759 quote
    JC_Bywan
    Moderator
    Master

    Good morning,

    You have swapped  parentheses and brackets in your average, try instead:

    MyRangeAverage = average[20](MyRange)

     

    On a side note, keyword “range” is already high-low, you don’t need to create it with “myrange”

    ZeroCafeine thanked this post
    #213762 quote
    JC_Bywan
    Moderator
    Master

    By the way, in the wake of yesterday’s “tip”, another tip to avoid such parentheses issues and save you time not having to find the problem and solve it: typing the start of the keyword (for example “aver” for average), and clicking in toolbar on the yellow lightbulb, it will propose all language keywords with “aver” inside, then click on the one wanted in the list and it will complete “aver” in your code, in this case “average[20](close)”, now that syntaxt is ok, replace 20 if needed, replace close if needed.

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

Range average, Big candle


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/26/2023
Status: Active
Attachments: 2 files
Logo Logo
Loading...