This commit is contained in:
2024-10-31 00:30:14 +03:30
parent 36f47d9f4f
commit d4dc005365
2 changed files with 476 additions and 363 deletions
+67 -2
View File
@@ -257,9 +257,9 @@ struct XTick
/**
* Init Tick by Symbol ...
*
*
* @param _symbol: String ...
*
*
* @return ( bool )
*/
bool Init(string _symbol)
@@ -7823,6 +7823,71 @@ double iGetPrice(
return (0);
}
/**
* Calculates Price Change Percentage based on
* Several Params ...
*
* @param _symbol: Symbol ...
* @param _period: Time Frame ...
* @param _from: start Bar Index ...
* @param _length: Length of Bars ...
*
* @return ( double )
*/
double GetPriceChanged(
string _symbol = NULL,
ENUM_TIMEFRAMES _period = NULL,
int _from = 0,
int _length = 3 //
)
{
//
double result = 0;
//
NormalizeSymbol(_symbol);
NormalizePeriod(_period);
//
if (_from < 0)
{
_from = 0;
}
//
if (_length < 2)
{
_length = 2;
}
//
if (_factor < 0.01)
{
_factor = 0.01;
}
//
double closes[];
int copiedCloses = CopyClose(
_symbol,
_period,
_from,
_length,
closes //
);
if (copiedCloses < _length)
{
return result;
}
//
double change = (closes[0] - close[5]) / close[5] * 100;
result = change;
//
return result;
}
//
// Calculate TP/SL for Specified Type of Positions ...
void CalculateTPSL(