📄 bar.~cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "jesse.h"
#include "bar.h"
#include "unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "BigCandl"
#pragma link "CandleCh"
#pragma link "OHLChart"
#pragma link "TeePageNumTool"
#pragma link "TeeTools"
#pragma resource "*.dfm"
TForm4 *Form4;
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
: TForm(Owner)
{
Series1->CandleWidth=10;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Chart1MouseWheelUp(TObject *Sender,
TShiftState Shift, TPoint &MousePos, bool &Handled)
{
//Chart1->ZoomPercent(2);
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Chart1MouseWheelDown(TObject *Sender,
TShiftState Shift, TPoint &MousePos, bool &Handled)
{
//Chart1->ZoomPercent(-2);
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Series1Click(TChartSeries *Sender, int ValueIndex,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
//Chart1->ZoomPercent(2);
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Chart1KeyPress(TObject *Sender, char &Key)
{
if(Key==VK_UP)Chart1->ZoomPercent(2);
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Series1AfterDrawValues(TObject *Sender)
{
//Series1->CandleWidth=6;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Chart1Zoom(TObject *Sender)
{
//if(Chart1->MaxPointsPerPage>5)
{
//Chart1->MaxPointsPerPage-=4;
//Series1->CandleWidth=Screen->Width/Chart1->MaxPointsPerPage;
}
//Series1->FirstValueIndex=4;
//Series1->CandleWidth=Series1->CandleWidth/1.1;
//Series1->LastValueIndex=Series1->FirstValueIndex+14;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Chart1UndoZoom(TObject *Sender)
{
//Series1->CandleWidth+=4;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Button1Click(TObject *Sender)
{
//Chart1->ZoomPercent(120);
//Series1->CandleWidth=Series1->CandleWidth+4;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Button2Click(TObject *Sender)
{
Chart1->UndoZoom();
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Button3Click(TObject *Sender)
{
Series1->RefreshSeries();
TDateTime t;
t=TDateTime::CurrentDate();
this->Caption=Form1->Caption;
Chart1->MaxPointsPerPage=0;
Series1->CandleWidth=8;
Series1->ColorEachPoint =true;
for(int i=0;i<Form1->nill;i++)
{
Series1->AddCandle(
EncodeDate( Form1->YYYY[i], Form1->MM[i], Form1->DD[i]),
Form1->OpenPrice[i],
Form1->HighPrice[i],
Form1->LowPrice[i],
Form1->ClosePrice[i]
);
}
for(int i=0;i<Form1->nill;i++)
{
if(Form1->Trend[i]==Form1->SUBRISE )Series1->ValueColor[i]=Form2->ColorBox1->Selected;
if(Form1->Trend[i]==Form1->NATURALRISE)Series1->ValueColor[i]=Form2->ColorBox2->Selected;
if(Form1->Trend[i]==Form1->RISETREND )Series1->ValueColor[i]=Form2->ColorBox3->Selected;
if(Form1->Trend[i]==Form1->NATURALDROP)Series1->ValueColor[i]=Form2->ColorBox4->Selected;
if(Form1->Trend[i]==Form1->DROPTREND )Series1->ValueColor[i]=Form2->ColorBox5->Selected;
if(Form1->Trend[i]==Form1->SUBDROP )Series1->ValueColor[i]=Form2->ColorBox6->Selected;
}
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -