//+------------------------------------------------------------------+ // MultiLookbackLines.mq5 // Converted…
- User
//+------------------------------------------------------------------+ //| MultiLookbackLines.mq5| //| Converted from EA by ChatGPT 2024 | //+------------------------------------------------------------------+ #property copyright "ChatGPT" #property version "2.01" #property indicator_chart_window #property strict
//--- inputs input ENUM_TIMEFRAMES InpTimeframe = PERIOD_H1; // Timeframe to look back on input int InpLookbackCandles = 10; // Base number of candles (>=1) input double InpMultiplier = 7.0; // Max multiplier (integer part used, >=1) input bool IncludeCurrentCandle = false; // Include current forming candle in calculations
input double InpMinimalDistancePoints = 20; // Minimal distance between lines, in points (>=0)
input color ColorHighLines_Base = clrRed; // Base color for high lines input color ColorLowLines_Base = clrBlue; // Base color for low lines input uint LineAlpha = 150; // Transparency 0-255 (0=fully transparent, 255=no transparency)
//--- defines for naming #define PREFIX_HIGH "MultiHL_High_" #define PREFIX_LOW "MultiHL_Low_"
//+------------------------------------------------------------------+ //| Global variables | //+------------------------------------------------------------------+ datetime lastBarTime = 0; // last processed bar time on input timeframe
double MinimalDistancePoints = 20.0; // working copy of minimal distance; modifiable color ColorHighLines; // working colors (with alpha) color ColorLowLines;
//+------------------------------------------------------------------+ //| Indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { // Input validation and assigning working variable if(InpLookbackCandles < 1) { Print("Error: InpLookbackCandles must be >= 1"); return(INIT_FAILED); } if(InpMultiplier < 1.0) { Print("Warning: InpMultiplier < 1, setting to 1"); } if(InpMinimalDistancePoints < 0) { Print("Warning: MinimalDistancePoints < 0, setting to 0"); MinimalDistancePoints = 0; } else MinimalDistancePoints = InpMinimalDistancePoints;
// Convert colors with alpha channel ColorHighLines = ColorModifyAlpha(ColorHighLines_Base, (uchar)LineAlpha); ColorLowLines = ColorModifyAlpha(ColorLowLines_Base, (uchar)LineAlpha);
ClearLines();
UpdateLines();
Print("MultiLookbackLines indicator initialized"); return(INIT_SUCCEEDED); }
//+------------------------------------------------------------------+ //| Indicator deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { ClearLines(); }
- Assistant
- User
no indicator plot defined for indicator 0 0 'ColorGetR' - undeclared identifier Liquidity Lines.mq5 354 21 'c' - some operator expected Liquidity Lines.mq5 354 31 ',' - unexpected token Liquidity Lines.mq5 357 22 'ColorMake' - undeclared identifier Liquidity Lines.mq5 357 11 ',' - semicolon expected Liquidity Lines.mq5 357 25 ')' - unexpected token Liquidity Lines.mq5 357 35 expression has no effect Liquidity Lines.mq5 357 30
- Assistant