Coding Filter For Volatility in Earning Seasons?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #191295 quote
    SkippyTrader
    Participant
    New

    Good day all,

    I am trying to add a filter for the volatility experienced during ‘Earning Reporting Seasons’. So for example just assuming a semi-annual reporting, that would starts around mid January and mid July (of course different markets have different reporting times). There is often increased volatile market, or rapid swings with news from earning reports, usually in the first few weeks of the earning season and then settling down towards end of reporting 6-odd weeks later (my hypothesis to test).  So i’m trying figure out this, to not open trades if market too volatile / choppy, during the first few weeks of earning season, to improve my auto-trading performance.

    Could someone help me with the code? I have tried the below code, it does seem to improver my performance (on backtesting). However i’m not entirely sure if  improved performance is due to the code its actually doing what i am planning for it to do / what i am trying to achieve? Also anyone have any ideas or suggestions?

    Much appreciated all 🙂

    Atr  = AverageTrueRange[14](close)
    PerC = Atr*100/close
    
    mm  = CurrentMonth
    dd  = OpenDay
    
    EarningSeason = (mm = 1 AND dd >=15) OR (mm = 7 AND dd >=15)
    
    IF not longonmarket and BUYCONDITION and NOT (EarningSeason and (PerC>n)) THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    IF not shortonmarket and SHORTCONDITION and NOT (EarningSeason and (PerC>n)) THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    #191302 quote
    robertogozzi
    Moderator
    Master

    It sounds correct and logical. You want to enter on some dates, if the ratio between ATR and price (CLOSE) is > a value of your choice (N).

    If that’s what you want, then I’d say it’s fine.

    SkippyTrader thanked this post
    #191358 quote
    SkippyTrader
    Participant
    New

    You want to enter on some dates, if the ratio between ATR and price (CLOSE) is > a value of your choice (N).

    Thanks. I want to NOT enter during the dates. If greater then value of my choice (N). Which looking at backtest results is what it is doing.

    For example to avoid buying during the whiplash’s that can occur in Earning Reporting Seasons when Megacap’s earnings come out; for example the large whiplash occurred after Facebook/Meta’s disappointed, and then the about-face change after Amazon beat analysts with their earning reports

    #191360 quote
    robertogozzi
    Moderator
    Master

    Sorry, I missed NOT.

    That doesn’t change much as to my reply, though.

    I actually have no idea about suggestions to help you.

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

Coding Filter For Volatility in Earning Seasons?


General Trading: Market Analysis & Manual Trading

New Reply
Author
Summary

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

Topic Details
Forum: General Trading: Market Analysis & Manual Trading
Language: English
Started: 04/06/2022
Status: Active
Attachments: No files
Logo Logo
Loading...