Help ! - Vertical Lines Separating Hours

#1
Hi,

Could someone point out my mistake here ?

I want amibroker to plot vertical lines at times mentioned in code (eg. 103000, 113000 etc).

Don't know what's wrong and why it doesn't plot anything.

PHP:
Mark1 =  TimeNum()>=103000 AND TimeNum()<=103003 ;
Mark2 =  TimeNum()>=113000 AND TimeNum()<=113003 ;
Mark3 =    TimeNum()>=123000 AND TimeNum()<=123003 ;
Mark4 =  TimeNum()>=133000 AND TimeNum()<=133003 ;
Mark5 =  TimeNum()>=143000 AND TimeNum()<=143003 ;
Mark6 =   TimeNum()>=153000 AND TimeNum()<=153003 ;
Mark7 =   TimeNum()>=163000 AND TimeNum()<=163003 ;
Mark8 =   TimeNum()>=173000 AND TimeNum()<=173003 ;
Mark9 =   TimeNum()>=183000 AND TimeNum()<=183003 ;
Mark10 =   TimeNum()>=193000 AND TimeNum()<=193003 ;
Mark11 =   TimeNum()>=203000 AND TimeNum()<=203003 ;
Mark12 =   TimeNum()>=213000 AND TimeNum()<=213003 ;
Mark13 =    TimeNum()>=223000 AND TimeNum()<=223003 ;
Mark14 =   TimeNum()>=233000 AND TimeNum()<=233003 ;



Plot(Mark1,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark2,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark3,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark4,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark5,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark6,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark7,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark8,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark9,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark10,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark11,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark12,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark13,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
Plot(Mark14,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
 

casoni

Well-Known Member
#2
Hi,

Could someone point out my mistake here ?

I want amibroker to plot vertical lines at times mentioned in code (eg. 103000, 113000 etc).

Don't know what's wrong and why it doesn't plot anything.
this will do the job ..

Mark1 = TimeNum()==103000 ;
Mark2 = TimeNum()==113000 ;
Plot(mark1,"",47,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);
Plot(mark2,"",47,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);
 

amitrandive

Well-Known Member
#4
this will do the job ..

Mark1 = TimeNum()==103000 ;
Mark2 = TimeNum()==113000 ;
Plot(mark1,"",47,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);
Plot(mark2,"",47,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);
Hi Casoni..

even that is not working..

is it working in your amibroker ?
It is working,use thick lines if you want.
Code:
Mark1 = TimeNum()==103000 ;
Mark2 = TimeNum()==113000 ;
Plot(mark1,"",12,styleHistogram|styleThick|styleNoLabel|styleOwnScale,0,1);
Plot(mark2,"",12,styleHistogram|styleThick|styleNoLabel|styleOwnScale,0,1);
 
#6
This is very strange. Any clues as to why it not working in my amibroker ?
Also, changed the color to black for my white bg. But it is not showing up !

 

casoni

Well-Known Member
#7
This is very strange. Any clues as to why it not working in my amibroker ?
Also, changed the color to black for my white bg. But it is not showing up !
make sure you have correct Market timings , in your database settings
i.e market start time = 91500 ....

then go to TOOLS >preferences > Intraday

select > START time of interval

:)
 

mastermind007

Well-Known Member
#9
This is very strange. Any clues as to why it not working in my amibroker ?
Also, changed the color to black for my white bg. But it is not showing up !

Your data stamp is not aligned at 00 seconds. So you need to do something and expand your time-zone (something like shown in red in following code) and partition away...

Also, you do not need 15 variables, 15 calls to plot for 15 lines.

Mark1 = ((TimeNum()>=102959) AND (TimeNum()<=103003))
OR ((TimeNum()>=112959) AND (TimeNum()<=113003))
OR ((TimeNum()>=122959) AND (TimeNum()<=123003));

Plot(Mark1,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
 

mastermind007

Well-Known Member
#10
Your data stamp is not aligned at 00 seconds. So you need to do something and expand your time-zone (something like shown in red in following code) and partition away...

Also, you do not need 15 variables, 15 calls to plot for 15 lines.

Mark1 = ((TimeNum()>=102959) AND (TimeNum()<=103003))
OR ((TimeNum()>=112959) AND (TimeNum()<=113003))
OR ((TimeNum()>=122959) AND (TimeNum()<=123003));

Plot(Mark1,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
In fact, if you want vertical separators at fixed intervals, you do not even need to spell the times out

Just do this first.
tn = (int(TimeNum() / 100)) % 100;

and plot it using
Plot(tn, "TN", colorBlack);


This will show razor like chart. Identify the values you want and
comment or delete the plot line away.

Next, plug in any of the two numbers that you had seen in the earlier plot
into the statement below
Mark1 = ((tn == 30) OR (tn == 00));
Plot(Mark1,"",colorBlack,styleHistogram |styleOwnScale|styleNoLabel,0,1);
 
Last edited:

Similar threads