Smart Money Concepts
Smart Money Concepts
//| SmartMoneyConcepts.mq4 |
//+------------------------------------------------------------------ +
#property indicator_chart_window
#property strict
#include <stdlib.mqh>
#include <ChartObjects\ChartObjectsTxtControls.mqh>
input int SwingLookback = 5; // Number of candles to look back for swing detection
//--- Buffers
double BOSBuffer[];
double CHOCHBuffer[];
//--- Variables
//+------------------------------------------------------------------+
//| Initialization |
//+------------------------------------------------------------------ +
int OnInit()
IndicatorBuffers(2);
SetIndexBuffer(0, BOSBuffer);
SetIndexArrow(0, 233);
SetIndexBuffer(1, CHOCHBuffer);
SetIndexArrow(1, 234);
return INIT_SUCCEEDED;
//+------------------------------------------------------------------ +
//+------------------------------------------------------------------ +
int OnCalculate(const int rates_total,
if (!isUpTrend)
CHOCHBuffer[i] = high[i];
isUpTrend = true;
else
BOSBuffer[i] = high[i];
lastHigh = currHigh;
if (isUpTrend)
CHOCHBuffer[i] = low[i];
DrawZone("SupplyZone" + i, Time[i], high[i], SupplyColor);
isUpTrend = false;
else
BOSBuffer[i] = low[i];
lastLow = currLow;
return rates_total;
//+------------------------------------------------------------------ +
//+------------------------------------------------------------------ +
if (tf == 0)
else
if (i >= 0)
return 0;
//+------------------------------------------------------------------+
//+------------------------------------------------------------------ +
//+------------------------------------------------------------------ +
//+------------------------------------------------------------------ +
void DrawText(string name, string text, int index, double price, color clr)