Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
weekly chart #459978
06/13/16 10:10
06/13/16 10:10
Joined: Apr 2014
Posts: 24
yebit Offline OP
Newbie
yebit  Offline OP
Newbie

Joined: Apr 2014
Posts: 24
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.

Re: weekly chart [Re: yebit] #459980
06/13/16 10:20
06/13/16 10:20
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
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.

Re: weekly chart [Re: jcl] #459989
06/13/16 11:15
06/13/16 11:15
Joined: Apr 2014
Posts: 24
yebit Offline OP
Newbie
yebit  Offline OP
Newbie

Joined: Apr 2014
Posts: 24
"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.

Re: weekly chart [Re: yebit] #460015
06/13/16 15:55
06/13/16 15:55
Joined: Apr 2014
Posts: 24
yebit Offline OP
Newbie
yebit  Offline OP
Newbie

Joined: Apr 2014
Posts: 24
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.

Re: weekly chart [Re: yebit] #460093
06/16/16 03:03
06/16/16 03:03
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline
Senior Member
boatman  Offline
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
Try this:

ColorUp = ColorDn = 0;

Re: weekly chart [Re: boatman] #460099
06/16/16 07:07
06/16/16 07:07
Joined: Apr 2014
Posts: 24
yebit Offline OP
Newbie
yebit  Offline OP
Newbie

Joined: Apr 2014
Posts: 24
That works. Thanks.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1