Putting lines in a graph

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

xkid
Posts: 1
Joined: Thu Jun 09, 2016 7:08 am

Putting lines in a graph

Postby xkid » Thu Jun 09, 2016 7:21 am

Hi, I have a hugge problem putting lines in a graph when programming

My graph has as y axis, numbers and as X axis, dates. Thus is the code i'm using:

grafico_overbought.draw(line,bottom, color(red)) "here I have to put the date"

when doig this, it allows me to make a red vertical line fro the x axis, however I need to do this for certain dates that follow a condition. I have a series object call "date" that contains the dates i'm using. My code is

For !t=1 to @obsrange
If rsi_gold(!t) > 70 then
grafico_overbought.draw(line,bottom, color(red)) date(!t)
endif
Next

If I put the date directly, for example 2/12/2008 (spanish format of the date) , the code works. but if I try to use a variable, the code runs, but it does not make the red lines. I've tried with everything, @makedate, @dateval, @datestr and all kind of date functions, but i does not work and I do not know what is wrong.

I will appreciate very much your help, thanks in advance!!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13605
Joined: Tue Sep 16, 2008 5:38 pm

Re: Putting lines in a graph

Postby EViews Gareth » Thu Jun 09, 2016 8:30 am

Try:

Code: Select all

For !t=1 to @obsrange If rsi_gold(!t) > 70 then %date = @datestr(date(!t)) grafico_overbought.draw(line,bottom, color(red)) %date endif Next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests