Last Works ...

This commit is contained in:
2024-10-31 13:27:39 +03:30
parent d4dc005365
commit ee49fcb905
4 changed files with 650 additions and 7 deletions
+1 -7
View File
@@ -7860,12 +7860,6 @@ double GetPriceChanged(
_length = 2;
}
//
if (_factor < 0.01)
{
_factor = 0.01;
}
//
double closes[];
int copiedCloses = CopyClose(
@@ -7881,7 +7875,7 @@ double GetPriceChanged(
}
//
double change = (closes[0] - close[5]) / close[5] * 100;
double change = (closes[0] - closes[5]) / closes[5] * 100;
result = change;
//
+67
View File
@@ -1644,4 +1644,71 @@ bool AddIfNotExists(
return result;
}
//
// State Extensions ...
/**
* Check State has Bullish Trend or not ...
*
* @param state: XPOIState instance ...
*
* @return ( bool )
*/
bool HasBullishTrend(XPOIState &state)
{
//
bool result = false;
//
// For Bullish Trends ...
int count = ArraySize(state.swingLows);
result = count >= 2;
if (!result)
{
return result;
}
//
XOHCL lastSwing = state.swingLows[count - 1];
XOHCL prevSwing = state.swingLows[count - 2];
//
result = lastSwing.low > prevSwing.low;
//
return result;
}
/**
* Check State has Bearish Trend or not ...
*
* @param state: XPOIState instance ...
*
* @return ( bool )
*/
bool HasBearishTrend(XPOIState &state)
{
//
bool result = false;
//
// For Bullish Trends ...
int count = ArraySize(state.swingHighs);
result = count >= 2;
if (!result)
{
return result;
}
//
XOHCL lastSwing = state.swingHighs[count - 1];
XOHCL prevSwing = state.swingHighs[count - 2];
//
result = lastSwing.high < prevSwing.high;
//
return result;
}
//