⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit2.cpp

📁 Jesse Livermore 方法,和三线翻转方法
💻 CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit2.h"
#include "jesse.h"
#include <IniFiles.hpp>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
        : TForm(Owner)
{
//Form1->Delta = (float)ScrollBar5->Position;
}
//---------------------------------------------------------------------------

void __fastcall TForm2::ScrollBar1Change(TObject *Sender)
{
gbb->Caption = "穿幅遍历:从"+AnsiString(ScrollBar1->Position)+"到"+AnsiString(ScrollBar2->Position)+"步"+AnsiString(ScrollBar3->Position);
gba->Caption = "穿越幅度[点数]:"+AnsiString(ScrollBar5->Position);
}
//---------------------------------------------------------------------------

void __fastcall TForm2::ScrollBar5Change(TObject *Sender)
{
gba->Caption = "穿越幅度[点数]:"+AnsiString(ScrollBar5->Position);
Form1->Delta = (float)ScrollBar5->Position;
}
//---------------------------------------------------------------------------

void __fastcall TForm2::StaticText1Click(TObject *Sender)
{
Form1->beginClick(Sender);
}
//---------------------------------------------------------------------------

void __fastcall TForm2::StaticText2Click(TObject *Sender)
{
Form1->Button1Click(Sender);
}
//---------------------------------------------------------------------------

void __fastcall TForm2::StaticText3Click(TObject *Sender)
{
Form1->Button2Click(Sender);
}
//---------------------------------------------------------------------------

void __fastcall TForm2::StaticText4Click(TObject *Sender)
{
Form2->Visible=false;
TIniFile *p = new TIniFile("c:\\Jesse.ini");
p->WriteInteger("FirstDay", "Trend", RadioGroup1->ItemIndex);
p->WriteInteger("CalcPrice", "Price", RadioGroup2->ItemIndex);
p->WriteInteger("Point", "Delta",  ScrollBar5->Position);
p->WriteInteger("PassThru", "From",  ScrollBar1->Position);
p->WriteInteger("PassThru", "To",  ScrollBar2->Position);
p->WriteInteger("PassThru", "Step",  ScrollBar3->Position);

p->WriteInteger("Color", "sr",  sr->Selected);
p->WriteInteger("Color", "nr",  nr->Selected);
p->WriteInteger("Color", "rt",  rt->Selected);
p->WriteInteger("Color", "sd",  sd->Selected);
p->WriteInteger("Color", "nd",  nd->Selected);
p->WriteInteger("Color", "dt",  dt->Selected);

delete p;

}
//---------------------------------------------------------------------------


void __fastcall TForm2::FormShow(TObject *Sender)
{
TIniFile *p = new TIniFile("c:\\Jesse.ini");
RadioGroup1->ItemIndex = p->ReadInteger("FirstDay", "Trend", 2);
RadioGroup2->ItemIndex = p->ReadInteger("CalcPrice", "Price", 3);
ScrollBar5->Position   = p->ReadInteger("Point", "Delta", 410 );
ScrollBar1->Position   = p->ReadInteger("PassThru", "From", 30 );
ScrollBar2->Position   = p->ReadInteger("PassThru", "To", 500 );
ScrollBar3->Position   = p->ReadInteger("PassThru", "Step", 10 );

sr->Selected    = p->ReadInteger("Color", "sr",  clWhite);
nr->Selected    = p->ReadInteger("Color", "nr",  clWhite);
rt->Selected    = p->ReadInteger("Color", "rt",  clRed);
sd->Selected    = p->ReadInteger("Color", "sd",  clWhite);
nd->Selected    = p->ReadInteger("Color", "nd",  clWhite);
dt->Selected    = p->ReadInteger("Color", "dt",  clBlack);

delete p;

}
//---------------------------------------------------------------------------

void __fastcall TForm2::FormClose(TObject *Sender, TCloseAction &Action)
{
StaticText4Click(Sender);
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -