last works ...
Resolve all XPOI XPivot and XPivotAnalysis Refactoring Side Affects on XFIMA ...
This commit is contained in:
@@ -645,94 +645,91 @@ bool CreateMainPanel()
|
||||
// edtPositionId.TextAlign(ALIGN_LEFT);
|
||||
// }
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//
|
||||
CButton btnPauseReplay;
|
||||
bool isVisualTesterPaused = false;
|
||||
|
||||
//
|
||||
// Initial Btn Pause Play ...
|
||||
int subWindow = 0;
|
||||
int defaultGap = 5;
|
||||
int defaultWidth = 100;
|
||||
int defaultHeight = 30;
|
||||
ulong chartId = eaExpert.eaChartHelper.ChartId();
|
||||
|
||||
//
|
||||
int btnPauseReplayX1 = defaultGap;
|
||||
int btnPauseReplayX2 = btnPauseReplayX1 + defaultWidth;
|
||||
int btnPauseReplayY1 = eaExpert.eaChartHelper.Height() - defaultHeight - defaultGap;
|
||||
int btnPauseReplayY2 = btnPauseReplayY1 + defaultHeight;
|
||||
|
||||
//
|
||||
string btnPauseReplayName = ShortName + "BTN_PAUSE_REPLAY";
|
||||
|
||||
//
|
||||
isInited = btnPauseReplay.Create(
|
||||
chartId,
|
||||
btnPauseReplayName,
|
||||
subWindow,
|
||||
btnPauseReplayX1,
|
||||
btnPauseReplayY1,
|
||||
btnPauseReplayX2,
|
||||
btnPauseReplayY2 //
|
||||
);
|
||||
if (isInited)
|
||||
{
|
||||
//
|
||||
// Apply Style ...
|
||||
string btnPauseReplayText =
|
||||
isVisualTesterPaused
|
||||
? "Play"
|
||||
: "Pause";
|
||||
btnPauseReplay.Text(btnPauseReplayText);
|
||||
btnPauseReplay.Color(clrAzure);
|
||||
btnPauseReplay.ColorBackground(clrBlack);
|
||||
}
|
||||
//
|
||||
// Initial Btn Pause Play ...
|
||||
int subWindow = 0;
|
||||
int defaultGap = 5;
|
||||
int defaultWidth = 100;
|
||||
int defaultHeight = 30;
|
||||
ulong chartId = eaExpert.eaChartHelper.ChartId();
|
||||
|
||||
//
|
||||
int btnPauseReplayX1 = defaultGap;
|
||||
int btnPauseReplayX2 = btnPauseReplayX1 + defaultWidth;
|
||||
int btnPauseReplayY1 = eaExpert.eaChartHelper.Height() - defaultHeight - defaultGap;
|
||||
int btnPauseReplayY2 = btnPauseReplayY1 + defaultHeight;
|
||||
|
||||
//
|
||||
string btnPauseReplayName = ShortName + "BTN_PAUSE_REPLAY";
|
||||
|
||||
//
|
||||
isInited = btnPauseReplay.Create(
|
||||
chartId,
|
||||
btnPauseReplayName,
|
||||
subWindow,
|
||||
btnPauseReplayX1,
|
||||
btnPauseReplayY1,
|
||||
btnPauseReplayX2,
|
||||
btnPauseReplayY2 //
|
||||
);
|
||||
if (isInited)
|
||||
{
|
||||
//
|
||||
// Update btn Pause Replay ...
|
||||
// Apply Style ...
|
||||
string btnPauseReplayText =
|
||||
isVisualTesterPaused
|
||||
? "Play"
|
||||
: "Pause";
|
||||
btnPauseReplay.Text(btnPauseReplayText);
|
||||
if (IsRunningeOnTestVisualMode())
|
||||
btnPauseReplay.Color(clrAzure);
|
||||
btnPauseReplay.ColorBackground(clrBlack);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// Update btn Pause Replay ...
|
||||
string btnPauseReplayText =
|
||||
isVisualTesterPaused
|
||||
? "Play"
|
||||
: "Pause";
|
||||
btnPauseReplay.Text(btnPauseReplayText);
|
||||
if (IsRunningeOnTestVisualMode())
|
||||
{
|
||||
//
|
||||
btnPauseReplay.Show();
|
||||
btnPauseReplay.Enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
btnPauseReplay.Hide();
|
||||
btnPauseReplay.Enable();
|
||||
}
|
||||
if (btnPauseReplay.Pressed())
|
||||
{
|
||||
//
|
||||
if (btnPauseReplay.IsEnabled())
|
||||
{
|
||||
//
|
||||
btnPauseReplay.Show();
|
||||
btnPauseReplay.Enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
btnPauseReplay.Hide();
|
||||
btnPauseReplay.Enable();
|
||||
}
|
||||
if (btnPauseReplay.Pressed())
|
||||
{
|
||||
//
|
||||
if (btnPauseReplay.IsEnabled())
|
||||
{
|
||||
//
|
||||
HandlePauseStrategyTester();
|
||||
|
||||
//
|
||||
btnPauseReplayText =
|
||||
isVisualTesterPaused
|
||||
? "Play"
|
||||
: "Pause";
|
||||
btnPauseReplay.Text(btnPauseReplayText);
|
||||
}
|
||||
HandlePauseStrategyTester();
|
||||
|
||||
//
|
||||
btnPauseReplay.Pressed(false);
|
||||
btnPauseReplayText =
|
||||
isVisualTesterPaused
|
||||
? "Play"
|
||||
: "Pause";
|
||||
btnPauseReplay.Text(btnPauseReplayText);
|
||||
}
|
||||
|
||||
//
|
||||
btnPauseReplay.Pressed(false);
|
||||
}
|
||||
|
||||
void HandlePauseStrategyTester()
|
||||
{
|
||||
@@ -745,3 +742,180 @@ void HandlePauseStrategyTester()
|
||||
keybd_event(VK_SPACE, 0, 0, 0);
|
||||
keybd_event(VK_SPACE, 0, KEYEVENTF_KEYUP, 0);
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
/// XFIMA ...
|
||||
///////////////////////////
|
||||
|
||||
//
|
||||
// ZIGZAG Pattern ...
|
||||
// if (detectZIGZAGPatterns)
|
||||
// {
|
||||
// //
|
||||
// // Detect Market Analysis ...
|
||||
// XZigZagAnalysis zAnalysis;
|
||||
// has = fima2Signaller.fimaPOIDetector.AnalyseMarketUsingZigZag(
|
||||
// cBar,
|
||||
// cBar.period,
|
||||
// fima2Signaller.fimaHelper,
|
||||
// zAnalysis,
|
||||
// 15 //
|
||||
// );
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// Print(ShortName + zAnalysis.GetMessage());
|
||||
|
||||
// //
|
||||
// XCZigZagAnalysisObject *iObj;
|
||||
// has = fima2Signaller.fimaPOIDrawer.DrawZigZagMarketAnalysisByPV(
|
||||
// iObj,
|
||||
// zAnalysis //
|
||||
// );
|
||||
// if (has)
|
||||
// {
|
||||
// draws.Add(iObj);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Reading Pivots ...
|
||||
double iLows[];
|
||||
double iHighs[];
|
||||
double lowTo = 0;
|
||||
double highTo = 0;
|
||||
double lowFrom = 0;
|
||||
double highFrom = 0;
|
||||
datetime lowToTime = NULL;
|
||||
datetime highToTime = NULL;
|
||||
datetime lowFromTime = NULL;
|
||||
datetime highFromTime = NULL;
|
||||
double lowsSlope = EMPTY_VALUE;
|
||||
double highsSlope = EMPTY_VALUE;
|
||||
double lowsIntercept = EMPTY_VALUE;
|
||||
double highsIntercept = EMPTY_VALUE;
|
||||
|
||||
//
|
||||
int iLoopbackLength = 50;
|
||||
for (int i = 0; i < iLoopbackLength; i++)
|
||||
{
|
||||
//
|
||||
double iLowPrice = iLow(_Symbol, _Period, i);
|
||||
double iHighPrice = iHigh(_Symbol, _Period, i);
|
||||
|
||||
//
|
||||
Add(
|
||||
iLowPrice,
|
||||
iLows //
|
||||
);
|
||||
Add(
|
||||
iHighPrice,
|
||||
iHighs //
|
||||
);
|
||||
}
|
||||
has = CalculateLinearRegression(
|
||||
lowsSlope,
|
||||
lowsIntercept,
|
||||
iLows,
|
||||
0,
|
||||
0 //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
lowToTime = GetBarTime(
|
||||
_Symbol,
|
||||
_Period,
|
||||
0 //
|
||||
);
|
||||
lowTo = CalculateValueBySlopeIntercept(
|
||||
lowsSlope,
|
||||
lowsIntercept,
|
||||
0 //
|
||||
);
|
||||
|
||||
//
|
||||
lowFromTime = GetBarTime(
|
||||
_Symbol,
|
||||
_Period,
|
||||
iLoopbackLength //
|
||||
);
|
||||
lowFrom = CalculateValueBySlopeIntercept(
|
||||
lowsSlope,
|
||||
lowsIntercept,
|
||||
iLoopbackLength //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
has = CalculateLinearRegression(
|
||||
highsSlope,
|
||||
highsIntercept,
|
||||
iHighs,
|
||||
0,
|
||||
0 //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
highToTime = GetBarTime(
|
||||
_Symbol,
|
||||
_Period,
|
||||
0 //
|
||||
);
|
||||
highTo = CalculateValueBySlopeIntercept(
|
||||
highsSlope,
|
||||
highsIntercept,
|
||||
0 //
|
||||
);
|
||||
|
||||
//
|
||||
highFromTime = GetBarTime(
|
||||
_Symbol,
|
||||
_Period,
|
||||
iLoopbackLength //
|
||||
);
|
||||
highFrom = CalculateValueBySlopeIntercept(
|
||||
highsSlope,
|
||||
highsIntercept,
|
||||
iLoopbackLength //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Try to Draw ...
|
||||
|
||||
//
|
||||
// Low ...
|
||||
CChartObjectTrend *iLowTrend;
|
||||
has = fima2Signaller.fimaPOIDrawer.DrawTrendLine(
|
||||
lowFrom,
|
||||
lowFromTime,
|
||||
lowTo,
|
||||
lowToTime,
|
||||
iLowTrend,
|
||||
"LOW_TREMD",
|
||||
true // Ray Right ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
draws.Add(iLowTrend);
|
||||
}
|
||||
|
||||
//
|
||||
// High ...
|
||||
CChartObjectTrend *iHighTrend;
|
||||
has = fima2Signaller.fimaPOIDrawer.DrawTrendLine(
|
||||
highFrom,
|
||||
highFromTime,
|
||||
highTo,
|
||||
highToTime,
|
||||
iHighTrend,
|
||||
"HIGH_TREMD",
|
||||
true // Ray Right ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
draws.Add(iHighTrend);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user