EntriesPerDirection

View as Markdown

Definition

Determines the maximum number of entries allowed per direction while a position is active based on the EntryHandling property.

This property ONLY applies to Managed order methods. When IsUnmanaged is set to true, Entry Handling properties will be hidden from the UI.

Property Value

An int value represents the maximum number of entries allowed. Default value is 1.

This property should ONLY be set from the OnStateChange() method during State.SetDefaults or State.Configure.

Syntax

EntriesPerDirection

Examples

If an open position already exists, subsequent EnterLong() calls are ignored.

1protected override void OnStateChange()
2{
3 if (State == State.SetDefaults)
4 {
5 EntriesPerDirection = 1;
6 EntryHandling = EntryHandling.AllEntries;
7 }
8}
9
10protected override void OnBarUpdate()
11{
12 if (CrossAbove(SMA(10), SMA(20), 1)
13 EnterLong("SMA Cross Entry");
14
15 if (CrossAbove(RSI(14, 3), 30, 1)
16 EnterLong("RSI Cross Entry");
17}

EnterLong() will be processed once for each uniquely named entry.

1protected override void OnStateChange()
2{
3 EntriesPerDirection = 1;
4 EntryHandling = EntryHandling.UniqueEntries;
5}
6
7protected override void OnBarUpdate()
8{
9 if (CrossAbove(SMA(10), SMA(20), 1)
10 EnterLong("SMA Cross Entry");
11
12 if (CrossAbove(RSI(14, 3), 30, 1)
13 EnterLong("RSI Cross Entry");
14}