Store Volatility number 1-2hrs before opening a trade

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9993 quote
    davidp13
    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
    Nicolas
    Keymaster
    Master

    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
    davidp13
    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
    Nicolas
    Keymaster
    Master

    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.

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 Nicolas
9 years, 7 months ago.

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