Store Volatility number 1-2hrs before opening a trade

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9993 quote
    davidp13davidp13
    Participant
    Average

    Hi all,

    I’m trying to test the volatility prior to opening a trade. I’m trying to identify if Volatility has spike over a certain number during the last two hours and if so the trade should not open. How do I go about effectively storing it to a variable and then re-use at the time the trades tests the market before it opens a trade?

    Thanks

    #9996 quote
    NicolasNicolas
    Keymaster
    Legend

    How do you measure volatility? If you have your own formula, you can look at its value with simple offset in the past.

    #9997 quote
    davidp13davidp13
    Participant
    Average

    I use the Chaikan Volatility indicator. So to measure the max, lets say from 7am to 9am one can use code like

    VOL = Volatility[10,10]
    
    IF TIME>=090000 and TIME <= 090000 THEN
    VOLATEST = MAX(VOLATEST,VOL)
    ENDIF

    That will give me the MAX no before the trade might open at 090500. But I need the reading to be ZERO before 7am and then ZERO again after 9am.

    Possible?

    #10001 quote
    NicolasNicolas
    Keymaster
    Legend

    You want to reset your VOLATEST value to 0 after 090000 ? Anyway, just set VOLATEST=0 at the TIME you want.

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Store Volatility number 1-2hrs before opening a trade


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
davidp13 @davidp13 Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/29/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...