How to add time in Price Chart ?

megapixel

Well-Known Member
#1
How to add time in Price Chart ?

I have written a small code .... but there is no time is displayed in the chart.

what I'm missing here ?




Here is the code:

_SECTION_BEGIN("AFL Coding");
SetBarFillColor( IIf( Close > Open, colorGreen, colorRed ) );
Plot(C,"Price", colorBlack, styleCandle );
Plot(EMA(C,3),"EMA(3)", colorRed );
Plot(EMA(C,15),"EMA(15)", colorGreen );
Buy=Cross(EMA(C,3),EMA(C,15));
Sell=Cross(EMA(C,15),EMA(C,3));
Filter = 1;
AddColumn( Close, "Close" );
_SECTION_END();
 

bharatk8

Active Member
#2
pl. add

radius = 0.45 * Status("pxheight");
textoffset = 2.4 * radius;
GfxSelectFont("Tahoma", 12 );//default 12
GfxSetTextColor( colorBlack );

GfxTextOut(Date() ,textoffset +450,10 );
GfxSetTextColor( colorBlack );


How to add time in Price Chart ?

I have written a small code .... but there is no time is displayed in the chart.

what I'm missing here ?




Here is the code:

_SECTION_BEGIN("AFL Coding");
SetBarFillColor( IIf( Close > Open, colorGreen, colorRed ) );
Plot(C,"Price", colorBlack, styleCandle );
Plot(EMA(C,3),"EMA(3)", colorRed );
Plot(EMA(C,15),"EMA(15)", colorGreen );
Buy=Cross(EMA(C,3),EMA(C,15));
Sell=Cross(EMA(C,15),EMA(C,3));
Filter = 1;
AddColumn( Close, "Close" );
_SECTION_END();
 
#3
Just add a title. that's all.

Code:
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
 

megapixel

Well-Known Member
#4
Just add a title. that's all.

Code:
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
This is making a big text ....I can not scroll to see full text in the screen ...I tried clicking right arrow next to the text ...but it does not scroll.

see this ...

 

sr114

Well-Known Member
#5
Just add a title. that's all.

Code:
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
use this
Code:
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} O: %g, Hi %g, Lo %g, Cls: %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
[/QUOTE]

now if u want to put the emas there put the EMA3 and EMA15 as E3 and E15.
this will shorten the text portion.
sr
 

asnavale

Well-Known Member
#6
This is making a big text ....I can not scroll to see full text in the screen ...I tried clicking right arrow next to the text ...but it does not scroll.

see this ...


Hi MP,

Modify your code as follows:

_SECTION_BEGIN("AFL Coding");
SetBarFillColor( IIf( Close > Open, colorGreen, colorRed ) );

Plot(C,"", colorBlack, styleCandle );
Plot(EMA(C,3),"EMA(3)", colorRed );
Plot(EMA(C,15),"EMA(15)", colorGreen );

_N(Title = StrFormat("{{NAME}}({{INTERVAL}} - {{DATE}}: {{OHLCX}}, Vol = %1.0f\n{{VALUES}}", V)):

Buy=Cross(EMA(C,3),EMA(C,15));
Sell=Cross(EMA(C,15),EMA(C,3));
Filter = 1;
AddColumn( Close, "Close" );
_SECTION_END();
 

megapixel

Well-Known Member
#7
use this
now if u want to put the emas there put the EMA3 and EMA15 as E3 and E15.
this will shorten the text portion.
sr
Still that does not fit well in the screen ...even with E3 , E15 ....

anyway ...I have removed everything ..keeping just "Close" price only...as we mostly deal with close prices.

This is ok now....I can live with this ...

 

megapixel

Well-Known Member
#8
Hi MP,

Modify your code as follows:

_SECTION_BEGIN("AFL Coding");
SetBarFillColor( IIf( Close > Open, colorGreen, colorRed ) );

Plot(C,"", colorBlack, styleCandle );
Plot(EMA(C,3),"EMA(3)", colorRed );
Plot(EMA(C,15),"EMA(15)", colorGreen );

_N(Title = StrFormat("{{NAME}}({{INTERVAL}} - {{DATE}}: {{OHLCX}}, Vol = %1.0f\n{{VALUES}}", V)):

Buy=Cross(EMA(C,3),EMA(C,15));
Sell=Cross(EMA(C,15),EMA(C,3));
Filter = 1;
AddColumn( Close, "Close" );
_SECTION_END();
your code has a bug buddy ...it says previous line has a missing semicolon ..this is not true....also I dont have Volume information in data file ...because I'm pulling google data.

anyway...thanks for the post and your time.
 
#9
This is making a big text ....I can not scroll to see full text in the screen ...I tried clicking right arrow next to the text ...but it does not scroll.

see this ...

Then add "\n" and your additional indicators will get a new line!
See here
Code:
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Op %g, Hi %g, Lo %g, Close %g (%.1f%%)\n {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
 

Similar threads