Print(ExitLongStop + "ExitLongStop " + Time[0]);
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.BertrandNinjaTrader Customer Service
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.BertrandNinjaTrader Customer Service
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=TraceOrdersBertrandNinjaTrader Customer Service
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
-
fiddy, per default those stops would expire on the next bar update seen. You can persist them with setting the liveUntilCancelled to true in the advanced overload offered for ExitLongStop. Then only the end of session handling would cancel any open orders of those.BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Brevo, Today, 01:45 AM
|
0 responses
6 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
3 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
241 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
6 views
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
Comment