Monthly Seasonality index – Help

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #67529 quote
    Alberto Lucchese
    Participant
    Average

    Hello,

    I’m interested in writing a basic indicator that will show the average variation in the last X years between the previous and current month. This is the first draft, so is nothing fancy, however as simple as it sems it doesn’t show anything. (this code is written for a monthly timeframe).

    Can someone help me check it?

    Thanks!

    For i=(Years-1) downto 0 do
    BarsCalc=Month+12*i
    PrevMonthCalc=BarsCalc+1
    cummulatedRatioHigh=High[BarsCalc]/High[PRevMonthCAlc]+cummulatedRatioHigh
    cummulatedRatioLow=Low[BarsCalc]/Low[PRevMonthCAlc]+cummulatedRatioLow
    cummulatedRatioClose=Close[BarsCalc]/Close[PRevMonthCAlc]+cummulatedRatioClose
    next
    AverageHigh=cummulatedRatioHigh/Years
    AverageLow=cummulatedRatioLow/Years
    AverageClose=cummulatedRatioclose/Years
    RETURN AverageHigh as "Average High", AverageLow as "Average Low", AverageClose as "Average Close"
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Monthly Seasonality index – Help


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/08/2018
Status: Active
Attachments: No files
Logo Logo
Loading...