From a62f245ba94f388c9a97ea4057869c6193c0fb00 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Sun, 19 May 2024 05:31:47 -0700 Subject: [PATCH] Normalize histogram value based on instrument tick size --- indicators/MACDHistogram.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indicators/MACDHistogram.cs b/indicators/MACDHistogram.cs index b6eaeb0..08042cb 100644 --- a/indicators/MACDHistogram.cs +++ b/indicators/MACDHistogram.cs @@ -54,8 +54,8 @@ namespace NinjaTrader.NinjaScript.Indicators if (CurrentBar < Math.Max(FastEMAPeriod, SlowEMAPeriod)) return; - double macdValue = fastEMA[0] - slowEMA[0]; - double previousMacdValue = fastEMA[1] - slowEMA[1]; + double macdValue = (fastEMA[0] - slowEMA[0]) / TickSize; + double previousMacdValue = Histogram[1]; Histogram[0] = macdValue;