|
// Example #1
// If an open position already exists, subsequent EnterLong() calls are ignored.
protected override void Initialize()
{
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
}
protected override void OnBarUpdate()
{
if (CrossAbove(SMA(10), SMA(20), 1)
EnterLong("SMA Cross Entry");
if (CrossAbove(RSI(14, 3), 30, 1)
EnterLong("RSI Cross Entry);
}
// Example #2
// EnterLong() will be processed once for each uniquely named entry.
protected override void Initialize()
{
EntriesPerDirection = 1;
EntryHandling = EntryHandling.UniqueEntries;
}
protected override void OnBarUpdate()
{
if (CrossAbove(SMA(10), SMA(20), 1)
EnterLong("SMA Cross Entry");
if (CrossAbove(RSI(14, 3), 30, 1)
EnterLong("RSI Cross Entry);
}
|