Программирование - это просто
Advertisement
arrow arrow , , arrow 12. Excel- (TStringList, Excel)
07.02.2023 .
1:
C#
Delphi
Web-
Excel-
.
12. Excel- (TStringList, Excel) E-mail
megabax   
24.12.2009 .
New Page 1

Excel- (TStringList, Excel).

.

, ( 8, 9, 10 11) , .  momStatAnaliz , .

TPASSStatStoreTextFile=class(TPASSStatStoreDataTemplate)
protected
      FStringList:TStringList;
      FFileName:string;
      FIsFirst:boolean;
public
      constructor Create(AFileName:String);
      procedure AddData(AParameters:TPASSParameters); override;
      procedure Save;
     destructor Destroy;
end;

, TPASSStatStoreDataTemplate - . , , . , Excel .

, :

constructor TPASSStatStoreTextFile.Create(AfileName:String);
begin
    inherited Create;
    FFileName:=AFileName;
    FIsFirst:=true;
    FStringList:=TStringList.Create;
end;

FIsFirst , AddData . , , :

procedure TPASSStatStoreTextFile.AddData(AParameters:TPASSParameters);
var cn,i:integer; s:string;
begin
    cn:=AParameters.Count-1;
    s:='';
    if FIsFirst then
    begin
        for i:=0 to cn do s:=s+AParameters[i].Name+'; ';
        FStringList.Add(s);
     end;
     FIsFirst:=false;
     s:='';
     for i:=0 to cn do s:=s+AParameters.AsStringByNum(i)+'; ';
     FStringList.Add(s);
end;

, , Save:

procedure TPASSStatStoreTextFile.Save;
begin
     FStringList.SaveToFile(FFileName);
end;

:

destructor TPASSStatStoreTextFile.Destroy;
begin
   FreeAndNil(FStringList);
   inherited Destroy;
end;

, TSaveDialog, - sdTextFile*:

          Excel- (TStringList,   Excel)

TfrmMomentum:

TfrmMomentum = class(TForm)
   odOpenDialog: TOpenDialog;
   mmMenu: TMainMenu;
   itFile: TMenuItem;
   itLoad: TMenuItem;
   lbResult: TLabel;
   btnCalk: TButton;
   seDT: TSpinEdit;
   lbDateTime: TLabel;
   seCandle: TSpinEdit;
   sdTextFile: TSaveDialog;
   lbResults: TListBox;
   Gauge: TGauge;
   procedure itLoadClick(Sender: TObject);
   procedure FormCreate(Sender: TObject);
   procedure btnCalkClick(Sender: TObject);
   procedure seCandleChange(Sender: TObject);
   procedure FormDestroy(Sender: TObject);
private
   { Private declarations }
   FPriceSource:TPASSPriceSource;
   FIndicator:TPASSMomentum;
   FDataStore:TPASSStatStoreTextFile;
  
FStatAnalizMomentum:TPASSStatAnalizMomentum;
public
   { Public declarations }
end;

OnClick ""

procedure TfrmMomentum.btnCalkClick(Sender: TObject);
begin
    if sdTextFile.Execute then
    begin
       if FIndicator<>nil then FreeAndNil(FIndicator);
       if FDataStore<>nil then FreeAndNil(FDataStore);
       if FStatAnalizMomentum<>nil then FreeAndNil(FStatAnalizMomentum);
       FIndicator:=TPASSMomentum.Create(seDT.Value,'Close');
       FIndicator.PriceSource:=FPriceSource;
       FDataStore:=TPASSStatStoreTextFile.Create(sdTextFile.FileName);
       FStatAnalizMomentum:=TPASSStatAnalizMomentum.Create(FIndicator,10,FDataStore);
       Gauge.MinValue:=0;
       Gauge.Progress:=0;
       Gauge.MaxValue:=FPriceSource.CountLoadedBars;
       FStatAnalizMomentum.Gauge:=Gauge;
       FStatAnalizMomentum.Test;
       FDataStore.Save;
   end;
end;

. , :

          Excel- (TStringList,   Excel)

, "", , .

          Excel- (TStringList,   Excel)

Excel, **:

          Excel- (TStringList,   Excel)

**:

          Excel- (TStringList,   Excel)

: **:

          Excel- (TStringList,   Excel)

**:

          Excel- (TStringList,   Excel)

 


, * ,    "Delphi", "Borland Software Corporation".

, ** ,    "Microsoft Excel", " Microsoft" 

 

( 11.07.2013 . )
 
« .   . »
 
© 2023 Программирование - это просто
Joomla! - , GNU/GPL.
© 2005-2008 Joom.Ru - Joomla!
Design by Mamboteam.com | Powered by Mambobanner.de
  .