TeeChart 8.02 Darvas Boxes
Posted: Thu Mar 20, 2008 5:17 pm
How do I find the top and bottom of a darvas box? That is, I want to develop additional logic based on whether a new value will be within or outside a particular Darvas box.
Steema Software - Customer Support Forums
http://216.92.101.67/support/
Code: Select all
for i:=0 to Series1.Count - 1 do
begin
tmpL:=Series1.Boxes[i].Left;
tmpR:=Series1.Boxes[i].Right;
tmpT:=Series1.Boxes[i].Top;
tmpB:=Series1.Boxes[i].Bottom;
end;
Code: Select all
DarvasSeries1: TDarvasSeries;
Code: Select all
DarvasSeries1.AddOHLC(ADate,AOpen,AHigh,ALow,AClose);
Code: Select all
With DarvasSeries1 Do
begin
tmpL:=(Boxes[count-1].Left);
tmpR:=(Boxes[count-1].Right);
tmpT:=(Boxes[count-1].Top);
tmpB:=(Boxes[count-1].Bottom);
end;
Code: Select all
(* HERE IS WHERE I GET AN ACCESS VIOLATION *)
AssignFile(Dfl,'DarvasHinges.txt');
Rewrite(Dfl);
showmessage(floattostr(darvasseries1.count)) ;
Chart1.Draw;
With DarvasSeries1 Do
for ii := 0 to Count-1 Do
begin
tmpL:=(Boxes[ii].Left);
tmpR:=(Boxes[ii].Right);
tmpT:=(Boxes[ii].Top);
tmpB:=(Boxes[ii].Bottom);
Writeln(Dfl,TickerSS+' ',tmpR,' ',tmpR,' ',tmpT,' ',tmpB);
end;
CloseFile(Dfl);
Code: Select all
(* HERE IS WHERE I GET AN ACCESS VIOLATION *)
AssignFile(Dfl,'DarvasHinges.txt');
Rewrite(Dfl);
//showmessage(floattostr(darvasseries1.count)) ;
Chart1.Draw;
With DarvasSeries1 Do
//for ii := 0 to Count-1 Do
for ii := 0 to Length(Boxes) Do
begin
tmpL:=(Boxes[ii].Left);
tmpR:=(Boxes[ii].Right);
tmpT:=(Boxes[ii].Top);
tmpB:=(Boxes[ii].Bottom);
Writeln(Dfl,TickerSS+' ',tmpL,' ',tmpR,' ',tmpT,' ',tmpB);
end;
CloseFile(Dfl);
Code: Select all
for ii := 0 to Length(Boxes) Do
begin
tmpL:=CalcXPos(Boxes[ii].Left);
tmpR:=GetVertAxis.CalcYPosValue(HighValues.Value[Boxes[ii].Right]);
tmpT:=CalcXPos(Boxes[ii].Top);
tmpB:=GetVertAxis.CalcYPosValue(LowValues.Value[Boxes[ii].Bottom]);
Writeln(Dfl,TickerSS+' ',tmpL,' ',tmpR,' ',tmpT,' ',tmpB);
end;
Code: Select all
for ii := 0 to Length(Boxes) Do
begin
tmpL:=XValue[Boxes[ii].Left];
tmpR:=HighValues.Value[Boxes[ii].Right];
tmpT:=XValue[Boxes[ii].Top];
tmpB:=LowValues.Value[Boxes[ii].Bottom];
Writeln(Dfl,TickerSS+' ',tmpL,' ',tmpR,' ',tmpT,' ',tmpB);
end;
Code: Select all
tmpL:=CalcXPos(Boxes[ii].Left);
tmpT:=GetVertAxis.CalcYPosValue(HighValues.Value[Boxes[ii].Top]);
tmpR:=CalcXPos(Boxes[ii].Right);
tmpB:=GetVertAxis.CalcYPosValue(LowValues.Value[Boxes[ii].Bottom]);
Code: Select all
tmpL:=XValue[Boxes[ii].Left];
tmpT:=HighValues.Value[Boxes[ii].Top];
tmpR:=XValue[Boxes[ii].Right];
tmpB:=LowValues.Value[Boxes[ii].Bottom];
Code: Select all
for ii := 0 to Length(Boxes)-1 Do
begin
tmpL:=XValue[Boxes[ii].Left];
tmpR:=HighValues.Value[Boxes[ii].Right];
tmpT:=XValue[Boxes[ii].Top];
tmpB:=LowValues.Value[Boxes[ii].Bottom];
Writeln(Dfl,TickerSS+' ',tmpL,' ',tmpR,' ',tmpT,' ',tmpB);
end;