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 charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
61 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
148 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
162 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
98 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
286 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|


Comment