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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
81 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
64 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
68 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
55 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|


Comment