Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Repetitious cancellation orders grinding system to a halt
Collapse
X
-
I did not have my output window open when it occurred this time. I will have it open and print the logs the next time it happens.if (reversalPrice != null)
{
if (Position.MarketPosition == MarketPosition.Long && Close[0] >= reversalPrice)
{
SetStopLoss(CalculationMode.Ticks, 5);
EnterShort(DefaultQuantity, "Scalp sell");
EnterShort(DefaultQuantity, "Sell short");
reversalPrice = null;
}
else if (Position.MarketPosition == MarketPosition.Short && Close[0] <= reversalPrice)
{
SetStopLoss(CalculationMode.Ticks, 5);
EnterLong(DefaultQuantity, "Scalp buy");
EnterLong(DefaultQuantity, "Buy");
reversalPrice = null;
}
}
Comment
-
SetProfitTarget is used only in the initialize section:
protected override void Initialize()
{
SetProfitTarget("Scalp sell", CalculationMode.Ticks, 8);
SetProfitTarget("Scalp buy", CalculationMode.Ticks, 8);
SetProfitTarget("Buy", CalculationMode.Ticks, 16);
SetProfitTarget("Sell short", CalculationMode.Ticks, 16);
IncludeCommission = true;
TimeInForce = Cbi.TimeInForce.Day;
EntriesPerDirection = 1;
TraceOrders = true;
EntryHandling = EntryHandling.UniqueEntries;
}
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
144 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
71 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
125 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
79 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|


Comment