Print(ExitLongStop + "ExitLongStop " + Time[0]);
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Print the current stop order
Collapse
X
-
You could create multiple IOrder objects, however as I have explained the other thread of yours in managed mode you then easily run into the managed mode order handling rules - just working with one order would be here and then updating the stop level as desired dynamically from your code to provide the trail aspects.
Comment
-
CalculateOnBarClose is always true in backtesting. If you would want to simulate trailing on a tick by tick basis the actual trail stop logic would have to be worked in using a finer series i.e tick one in your strategy script. The same would hold for the SetTrailStop, in backtesting it would be based on your primary series with CalculateOnBarClose = true only.
Comment
-
Missing Stops
Hi Bertrand
I have tried to create a trail stop system using IOrder as you suggested
Attached is the code.
The problem I have is that in some instances the market doesn't acknowledge the stop in place.
even though I know they are there as I have printed out stops at various time to ensure that they are correct.
Also in some instances the code seems to work as I would expect.
Any suggestions to find out why the stops aren't working?
Comment
-
Hi fiddy, for the time when the stop seems ignored, what TraceOrders print would you see? That's usually the best way to start debugging such scenarios alongside the Prints you already have implemented - http://www.ninjatrader.com/support/h...ub=TraceOrders
Comment
-
Thanks for advice
The Stop gets placed correctly however for some reason it is cancelled later due to expiring.
What would cause the order to expire on ExitLongStop?
31/03/2012 5:00:00 AM Entered internal PlaceOrder() method at 31/03/2012 5:00:00 AM: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.0303 SignalName='' FromEntrySignal=''
3/04/2012 5:00:00 AM Cancelled expired order: BarsInProgress=0: Order='NT-00001/Backtest' Name='Sell' State=Working Instrument='$AUDUSD' Action=Sell Limit price=0 Stop price=1.0303 Quantity=0 Strategy='Pinstar' Type=Stop Tif=Gtc Oco='' Filled=0 Fill price=0 Token='59806abdcfc24ad9bfebdbe803c3a5cb' Gtd='1/12/2099 12:00:00 AM'
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
596 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
554 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment