weekly chart

Posted By: yebit

weekly chart - 06/13/16 10:10

I guess Zorro is not designed for this, but I want to plot a chart with weekly data.

I've read the manual exhaustively and I've taken the steps as recommended in the manual, shown below, but the bars remain daily, not weekly as promised:

set(PLOTNOW);
BarPeriod = 1440;
TimeFrame = frameSync(7);
vars Price = series(price());

I have changed the order of the above statements and tried many different values for both. I have used PlotDate, MaxBars, TimeFrame, StartDate, EndDate, all in different combinations, orders and values, but always Zorro charts daily bars (except when BarPeriod is reduced, plotting more frequently than daily, moving even further away from the weekly goal).

If anyone has tried this and made it work, please post the solution here. Thankyou.
Posted By: jcl

Re: weekly chart - 06/13/16 10:20

Indeed I have not yet heard of a strategy based on weekly bars. How would you backtest it with only a few hundred bars? But your code does not plot weekly candles anyway, it only defines a 7-days time frame. A candle is still 1 day.

For really plotting weekly candles, you had to either define an individual bar length with the bar() function, or plot them with rectangles. I guess that's probably not worth the hassle.
Posted By: yebit

Re: weekly chart - 06/13/16 11:15

"Use BarPeriod = 1440 and TimeFrame = framesync(7) for weekly time frames." (from the manual BarPeriod remarks).

that's what I thought meant weekly charting. Well I guess I'm just used to a weekly view from equities trading so I have to adjust to this. I've read your thoughts on Financial Hacker, so I realise the futility of visually exploring price action, but I wanted to look at how indicators interacted, sort of a starting point for me.

Dailies it is then. Thanks for the response.
Posted By: yebit

Re: weekly chart - 06/13/16 15:55

I went ahead and scripted a weekly bar chart, closely following the example given in the plot page in the manual:
Code:
function plotWeekly() {
  set(PLOTNOW);
  vars Price = series(price());
  BarPeriod = 1440;
  TimeFrame = 7;

  if(Bar%7 == 0) {
    plotGraph("weeklyBarRange", 0, priceHigh(),  LINE,     BLUE);
    plotGraph("weeklyBarRange", 0, priceLow(),   LINE|END, BLUE);
    plotGraph("weeklyBarOpen",  0, priceOpen(),  LINE,     BLUE);
    plotGraph("weeklyBarOpen",  2, priceOpen(),  LINE|END, BLUE);
    plotGraph("weeklyBarClose", 0, priceClose(), LINE,     BLUE);
    plotGraph("weeklyBarClose",-2, priceClose(), LINE|END, BLUE);
  }
}


These weekly ranges make it clear to me that only Sopov and the Knockerfellers are going to be swing trading forex.

Although the manual does say:
Quote:
For removing default chart elements such as price candles or equity curves, set their Color to 0.

I can't figure out how to hide the daily bars that show up. Any ideas? Thanks.
Posted By: boatman

Re: weekly chart - 06/16/16 03:03

Try this:

ColorUp = ColorDn = 0;
Posted By: yebit

Re: weekly chart - 06/16/16 07:07

That works. Thanks.
© 2024 lite-C Forums