Volatility indicator

Forums ProRealTime English forum ProBuilder support Volatility indicator

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • #90282

    To forum members,

    I have been using a volatility based indicator within other programs, Beyond Charts, Metastock, to act as a Macro over an index.

    If the market volatility is too great, say above 8%, then I do not enter any positions.

    There does not appear to be such an indicator available within Pro Real Time.

    The code for such an indicator from Metastock is as follows:

    XAOATR:=Security(“C:Trading DataStocksASXIndicesXAO”,ATR(5));
    XAO:=Security(“C:Trading DataStocksASXIndicesXAO”,C);
    XAOATR/XAO*100;
    5;
    7;
    ATR(5)/C*100; 5; 7;

    So if possible can this code be translated into ProRealCode. The index which I am trialing it on is the Nasdaq.

    Hoping this makes sense and someone is able to help.

    Kind regards

    mjharm.

     

    1 user thanked author for this post.
    #90318

    That could be coded like this:

    (not tested).

    1 user thanked author for this post.
    #90392

    Thank you Nicolas very much for your prompt expertise in coding the volatility formula I recently posted.

    I have tested it and when it displays on a chart ( Ticker- Nasdaq, Name- US Tech 100 Cash ) the desired result is not displayed.

    As an example- ATR is 323 and the Close price is 6876. Therefore 323/6876*100 = 4.69%.

    The window at the bottom which has the Volat line applied to it displays 94.48.

    Also enquiry with regard to the values on the right hand side of the displayed window – Is it possible to make the scale a percentage instead of a number which it currently is?

    Happy to accept these questions may be more appropriate to IG direct and if so please advise and I will follow up with them.

    Kind regards

    mjharm

     

     

    #90394

    The code I made is actually making the right calculation according to your original code.

    Take ATR of 5 periods, divided it by the current Close and put it in percentage format.

    If I take the value of yesterday Sunday 3rd (on a daily timeframe),

    ATR is 90.20, Close is 6874.4, so the formula returned 90.20/6874.4*100 = 1.31%

    See attached picture.

    1 user thanked author for this post.
    #90489

    Hi Nicolas,

    Yes you are correct. I was not putting the code in its own window below the chart- I was placing the indicator- aptly  called ‘ nicolas volat’ – inside of the ATR window.

    Rookie mistake no doubt. Your attached image cleared up the problem.

    Thanks again Nicolas – you are a legend!

    mjharm

Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login