When a stop is triggered, the Parabolic SAR should immediately reverse position making a new stop position valid, but it doesn't. The indicator waits until the next bar before placing the reversal. Any thoughts on fixing this?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Parabolic SAR Automated Strategy doesn't work.
Collapse
X
-
Parabolic SAR Automated Strategy doesn't work.
I have tried to set up the simplest autotrade ninjascript strategy in the world. Basically using the Parabolic SAR and stop orders. The strategy consistently misses trades and will not exit propoerly because of a flaw in the Parabolic SAR.
When a stop is triggered, the Parabolic SAR should immediately reverse position making a new stop position valid, but it doesn't. The indicator waits until the next bar before placing the reversal. Any thoughts on fixing this?
Tags: None
-
Hi, please check the attached sample for the ParabolicSAR reveral trades. This one reverses the position when the Close crosses the Parabolic value plus a tick offset. In your screenshot you don't use a reversal order, just an ExitShort which puts you into a flat state after being short.
The strategy will also have to wait for the bar that penetrates the SAR to be closed and then it places the order for the next bar, since you cannot look 'into' the bar.
If you need this tested with more resolution, I would suggest looking at this reference sample on how to add a finer datastream to simulate intrabar execution - http://www.ninjatrader-support2.com/...ead.php?t=6652Attached FilesBertrandNinjaTrader Customer Service
-
Originally posted by NinjaTrader_Bertrand View PostIn your screenshot you don't use a reversal order, just an ExitShort which puts you into a flat state after being short.
Here are another 2 examples of the reversal not working when the price action is triggered.
I think that fixing the indicator is as simple as referencing the high or low of the previous bar rather than the default input series. One thing is for certain, the parabolic doesn't work properly in it's current formulation.
So in my opinion this is not an intrabar issue. It is a functional error of the indicator in ninja itself. There is no denying that the reversal should have been triggered both times. So how can this be fixed?
Comment
-
This is a great link and saves a question about better resolution for the Stochastic specifically. Thanks.
Originally posted by NinjaTrader_Bertrand View PostIf you need this tested with more resolution, I would suggest looking at this reference sample on how to add a finer datastream to simulate intrabar execution - http://www.ninjatrader-support2.com/...ead.php?t=6652
Comment
-
In backtesting, all orders placed on the signal bar are always executed on the next bar. On the signal bar, you evaluated a signal as of the point in time when you already have the closing price for that bar. Next tradeable location is the open of the next bar.
In real-time, the same is true if you have CalculateOnBarClose set to true.
You cannot evaluate your system visually. Please use Print()s along with TraceOrders to determine the values of your conditions at each point in time. http://www.ninjatrader-support2.com/...ead.php?t=3418Josh P.NinjaTrader Customer Service
Comment
-
Great you got it working, to clarify: the indicator itself works just fine. I just used the correct order to reverse position in my posted zip you tried out. In your strategy you were using ExitLong and ExitShort, those will get you flat, but not reverse as you liked. If you are for example long and issue a EnterShort it will close the long position and get you into a new short position.BertrandNinjaTrader Customer Service
Comment
-
Since it was build in the wizard, you can modify it there and add a trailing stop on the 'Stops and Targets' page - http://www.ninjatrader-support.com/H...rdScreens.htmlBertrandNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Bertrand View PostIn your strategy you were using ExitLong and ExitShort, those will get you flat, but not reverse as you liked. If you are for example long and issue a EnterShort it will close the long position and get you into a new short position.
Furthermore, the ParabolicSAR is intended to be used with STOP orders at the calculated values, not market orders at crossing points. So the autotrade solution you provided is not really accurate. The point is that the reverse of all the long trades should equal exactly all the short trades at every entry and exit point. On to the problem at hand.
Unfortunately, the problem has reared its head on ENTRY again.
In the following example, there is only 1 step in the entry strategy as follows:
This single entry command results in the following entry points from the March 7th ES contract data.
Note the MISSED ENTRY POINT at 680.25 which happens to be exactly where the new ParabolicSAR value = the open price of the next bar. I am not sure if this is a correct value calculation (I don't have my copies of the indicator as published in Wilder's "New Concepts in Technical Analysis" where the indicator was invented and explicitly calculated piece by piece painstakingly by hand. He is the inventor afterall.)
The conflict arises in that you can't enter a long stop order when the current market price is equal to or greater than the Parabolic value of the stop order.
The obvious solution would be to add a secondary long stop entry at the previous value of the Parabolic, so that if the order in step one fails to execute, then the stop still active at the previous value would.
So to compensate, I create step 2 which also places a stop order at the previous value of the Parabolic with the following command:
Which results in the following chart...
So now the final entry point is corrected for, but the second entry point is now incorrect. It appears as though the Parabolic[1] value was used to trigger the stop entry instead of Parabolic[0]. This makes no sense to me since clearly the lower value of Parabolic[0] should be triggered first.
Any thoughts why this problem is occuring? Doesn't seem to matter if I use calculate on close or not. Kind of frustrating.Attached Files
Comment
-
Updated Version - Same Problem
As per Bertrand's instructions, I installed the latest version of Ninjatrader X.9 released yesterday and reran the strategy. Same result. Some of hte time, the stop on the previous bar's Parabolic is triggered which should not happen. Other times it works fine. Case in point, Tuesday's market data on ES. So why is this still happening?
Is there a problem executing stop orders in strategies in general?
Comment
-
Hi, thanks for the update - can you please post the code you used to arrive at this? Just because you use the Parabolic indicator for generating your signals, it does not mean you use place the orders as a certain type, limit / stop...so if you place a market order after the condition occured this may explain the difference you witness. Thanks!BertrandNinjaTrader Customer Service
Comment
-
Filling orders right away.
Every strategy that use always fills my order right away. How do I stop this from happening? A lonng is placed and then the order takes me out the same time I place the trade.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cyberpete76, 03-27-2023, 12:29 AM
|
7 responses
267 views
1 like
|
Last Post
by slightly
Today, 01:47 AM
|
||
Started by renewsaltwater, Today, 01:15 AM
|
0 responses
2 views
0 likes
|
Last Post Today, 01:15 AM | ||
Started by slightly, Today, 12:49 AM
|
0 responses
4 views
0 likes
|
Last Post
by slightly
Today, 12:49 AM
|
||
Started by sdauteuil, 09-23-2021, 10:16 AM
|
4 responses
1,210 views
0 likes
|
Last Post Yesterday, 11:41 PM | ||
Started by agclub, 04-21-2024, 08:57 PM
|
5 responses
37 views
0 likes
|
Last Post
by agclub
Yesterday, 09:47 PM
|
Comment