[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Need some help to get plots correct



PureBytes Links

Trading Reference Links

Graham,

I don't have the right kind of database to test your code, so just some ideas/questions you probably have already tried...

Since there's only a single plot statement seems like it should fill the chart area. Makes me wonder if there's some data we can't see causing the scaling problem.

Have you tried removing the title statement to see if values show up?

I've never tried a plot statement inside a loop before. Have you tried moving it out of the loop? In fact, how'd you get the loop to work without using subscripts[x]? It's also curious to me that the plot data is so regular (repeating).

So I couldn't be of more help.

Terry

Graham wrote:
I am running analysis on intraday composite ticker

//Scan with settings=1 minute
UseTrade = TimeNum() <= ValueWhen( Cross( TimeNum(), 160001 ), TimeNum() );
Vc = V*C/1000;
Buy=1;
Comp="~ASX100";
AddToComposite(O*usetrade,Comp,"O",1+2+4+16);
AddToComposite(H*usetrade,Comp,"H",1+2+4+16);
AddToComposite(L*usetrade,Comp,"L",1+2+4+16);
AddToComposite(C*usetrade,Comp,"C",1+2+4+16);
AddToComposite(Vc*usetrade,Comp,"V",1+2+4+16);
AddToComposite(TimeFrameExpand(TimeFrameCompress(1,inDaily),inDaily)*usetrade,Comp,"I",1+2+4+16);

Then analysing some things, this is attempt to get a running overall
average of the turnover at each intraday timezone.
numdays = Cum(DateNum()!=Ref(DateNum(),-1))+1;
numint = (6*60+15)*60/Interval();


mycolor=IIf(Hour()<12, colorBlue,
 IIf(Hour()>=12 AND Hour()<14,colorRed,
 IIf(Hour()>=14 AND Hour()<16,colorGreen,
 colorBlack)));

Filter=1;
for(x=0;x<=numint;x++)
{
timex = 100000 + int(Interval()*x/3600)*10000 + (Interval()*x/60)%60*100;
cumx = Cum( timex==TimeNum() ) +1;
//Vcum = Cum( IIf(TimeNum()==timex,V,0) )/Cumx;
Vcum = Cum( IIf(TimeNum()==timex,V,0) )/numdays;
Plot(Vcum*(timex==TimeNum()), "", mycolor, styleArea);
AddColumn(Vcum,"Vcum etc",1);
}
_N(
Title = "{{NAME}} -{{INTERVAL}} {{DATE}} - Average Activity  {{VALUES}}" );


I have some minor problems trying to get it right and hoping for some help

1. As the number of stocks inj my intraday history varies, not all
have first date of starting) I wanted to average out over the number
of stocks. This is OK if I stay at 1  minute display but in say hourly
the number of stocks (OI field) adds up each data bit so instead of
getting 20 as per the number used I can get 160. I need some way to
keep each bar as the actual number of stocks, noy summed together.

2. The plot is a small part in middle of screen, with large area above
and below. I want to make it more normal looking with bottom and top
of bars with the screen, See attached screen shot

3. The above code works to plot, but I cannot get any values to show
in the title.