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 argusthome, 03-08-2026, 10:06 AM
|
0 responses
79 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
45 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
29 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
32 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
65 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|


Comment