Skip to main content

ILevelsIndicator

Interface for indicators that support interactive horizontal price levels on the chart. Users can add, remove, drag, and set alerts on levels. Levels persist across sessions via XML serialization.

Namespace: MZpack Inheritance: ILevelsIndicator : IIndicator

Implemented by LevelsIndicator (abstract), which is the base class for mzBigTrade, mzFootprint, mzMarketDepth, and mzVolumeDelta. There is no standalone "mzLevels" indicator — levels are a feature built into these order flow indicators.

Properties

Data

PropertyTypeDescription
LevelsList<LevelBase>Collection of all price levels on the chart

Enable / Disable

PropertyTypeDefaultDescription
LevelsEnabledboolMaster switch for levels feature

Alert Configuration

PropertyTypeDefaultDescription
UseLevelAlertbooltrueEnable alerts on levels
LevelAlertEventAlertEventLevelCrossWhen alert fires: touch or cross
LevelAlertRearmbooltrueRe-arm alert after it fires
LevelAlertRearmIntervalint3Re-arm interval in seconds
LevelAlertSoundstring"crossed.wav"Sound file for alert

Interaction

PropertyTypeDefaultDescription
AddRemoveLevelKeyKeyBaseLeftShiftMouse Left + key to add/remove a level
ModifyLevelKeyKeyBaseLeftAltMouse Left + key to open level properties
MouseDragLevelsbooltrueAllow dragging levels with the mouse

Methods

MethodReturnsDescription
CreateLevel(IVisual, double, bool)LevelBaseCreate a new level at the given price
GetLevelValueByY(int)doubleConvert a Y pixel coordinate to a price value
GetCurrentChartValue(double)doubleConvert a level value to the current chart coordinate

LevelBase (abstract class)

Base class for all level objects. Each level represents a horizontal line at a specific price.

Namespace: MZpack Inheritance: LevelBase : VisualBase

Properties

PropertyTypeDefaultDescription
ValuedoublePrice level
LabelstringDisplay label
DurationLevelDurationInfiniteHow long the level persists
DirectionLevelDirectionUpAlert direction filter
UseAlertbooltrueAlert enabled for this level
EventAlertEventLevelTouchAlert event type for this level
DrawOnRightCanvasbooltrueDraw on the right canvas area

Methods

MethodReturnsDescription
CheckAlert(double, DateTime)boolEvaluate whether the alert should fire at the given price and time
AssignValue(double)voidSet the price value

Enums

LevelDuration

ValueDescription
InfiniteLevel persists indefinitely
CustomLevel has a defined start/stop time range

LevelDirection

ValueDescription
UpAlert only when price crosses up through the level
DownAlert only when price crosses down through the level
UpDownAlert on any crossing

AlertEvent

ValueDescription
LevelTouchAlert fires when price touches the level
LevelCrossAlert fires when price crosses through the level

Example

// Access levels from any indicator that implements ILevelsIndicator
ILevelsIndicator indicator = footprintIndicator;

if (indicator.LevelsEnabled)
{
foreach (var level in indicator.Levels)
{
double price = level.Value;
string label = level.Label;
// Check if current price triggers this level's alert
bool alert = level.CheckAlert(currentPrice, DateTime.Now);
}
}

// Create a new level programmatically
var newLevel = indicator.CreateLevel(owner, 4500.00, zeroBased: false);