This commit is contained in:
2025-03-29 04:11:38 +03:30
parent b2c585bc93
commit 1b93b469a1
9 changed files with 2811 additions and 15 deletions
@@ -53,7 +53,7 @@ input bool showDeltaMa = true; // Show Delta Moving Average
#property indicator_separate_window
//
#property indicator_buffers 5
#property indicator_buffers 6
#property indicator_plots 3
//
@@ -107,6 +107,10 @@ double deltaMaBuffer[];
#define rawDeltaBufferIndex mLastBufferIndex + 1
double rawDeltaBuffer[];
//
#define deltaStateBufferIndex mLastBufferIndex + 2
double deltaStateBuffer[];
//
// Variables, Properties and etc ...
@@ -343,6 +347,10 @@ void DefineBuffers()
//
ArraySetAsSeries(rawDeltaBuffer, true);
SetIndexBuffer(rawDeltaBufferIndex, rawDeltaBuffer, INDICATOR_CALCULATIONS);
//
ArraySetAsSeries(deltaStateBuffer, true);
SetIndexBuffer(deltaStateBufferIndex, deltaStateBuffer, INDICATOR_CALCULATIONS);
}
/**
@@ -407,8 +415,9 @@ void FillBuffersZero(int barIndex)
//
rawDeltaBuffer[barIndex] = 0.0;
deltaLineBuffer[barIndex] = 0.0;
deltaStateBuffer[barIndex] = 0.0;
deltaHistogramBuffer[barIndex] = 0.0;
deltaMaBuffer[barIndex] = EMPTY_VALUE;
deltaMaBuffer[barIndex] = 0.0;
deltaHistogramColorBuffer[barIndex] = hideColorIDX;
}
@@ -470,11 +479,9 @@ void CalculateValues(
if (isFirstBar)
{
//
rawDeltaBuffer[bar_index] = iDelta;
deltaLineBuffer[bar_index] = iDelta;
deltaHistogramBuffer[bar_index] = iDelta;
//
rawDeltaBuffer[bar_index] = iDelta;
}
else
{
@@ -485,21 +492,25 @@ void CalculateValues(
rawDeltaBuffer[bar_index] = iDelta;
deltaLineBuffer[bar_index] = iDelta;
deltaHistogramBuffer[bar_index] = iDelta;
//
// deltaLineBuffer[bar_index] = deltaLineBuffer[bar_index + 1] + iDelta;
// deltaHistogramBuffer[bar_index] = deltaHistogramBuffer[bar_index + 1] + iDelta;
// //
// rawDeltaBuffer[bar_index] = rawDeltaBuffer[bar_index + 1] + iDelta;
}
//
// Setting iDelta State ...
double iState = iDelta > 0
? bullishColorIDX
: iDelta < 0
? bearishColorIDX
: hideColorIDX;
//
// Setting iDelta Color ...
double iDeltaColor = iDelta > 0
? bullishColorIDX
: iDelta < 0
? bearishColorIDX
: hideColorIDX;
//
deltaStateBuffer[bar_index] = iState;
deltaHistogramColorBuffer[bar_index] = iDeltaColor;
//