update to my MQL5 Libs

This commit is contained in:
Matt Corcoran
2025-07-07 15:43:17 +02:00
parent 10c1d86a0c
commit e9fc8ada0d
10 changed files with 885 additions and 575 deletions
+10 -6
View File
@@ -42,17 +42,21 @@ double MarketDataUtils::get_latest_buffer_value(int handle) {
return 0.0;
}
// Retrieves a historical buffer value at specified shift
// shift = 0 refers to the live candle (still forming)
// shift = 1 is the most recently closed candle
// shift = 2 is the one before that, etc.
double MarketDataUtils::get_buffer_value(int handle, int shift) {
double val[];
ArraySetAsSeries(val, true);
if (CopyBuffer(handle, 0, shift, 1, val) == 1)
return val[0]; // Historical value at given shift
double val[];
ArraySetAsSeries(val, true);
return 0.0;
if (CopyBuffer(handle, 0, shift, 1, val) == 1 && val[0] != EMPTY_VALUE)
return val[0];
return EMPTY_VALUE;
}
// Adjusts the point value for symbol to account for fractional pips (e.g., 5-digit brokers)
double MarketDataUtils::adjusted_point(string symbol) {
int symbol_digits = (int)SymbolInfoInteger(symbol, SYMBOL_DIGITS);