I have one other problem, it seems to give me results as if I have moved my stop...I am testing an exit at 60 pips, I have not put any trailing stop code in, but it seems to give me profit results which are positive based on exiting at the stop, i.e. not 60 pips but a variety of amounts below 60 pips. Is there an inbuilt trailing stop at work?
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
Stop Loss Offset
Collapse
X
-
Thanks Dierk, that works!
I have one other problem, it seems to give me results as if I have moved my stop...I am testing an exit at 60 pips, I have not put any trailing stop code in, but it seems to give me profit results which are positive based on exiting at the stop, i.e. not 60 pips but a variety of amounts below 60 pips. Is there an inbuilt trailing stop at work?
-
>> Is there an inbuilt trailing stop at work?
No, unless you coded it. I suggest tracing your strategy as per here to understand what's going on: http://www.ninjatrader-support.com/v...ead.php?t=3627
Comment
-
What I've found out is that it's reading the stop calculation as a moving stop - recalculating on every new bar update it so that it moves with price, similar to a trailing stop - I've looked at the charts and it stops out on a retracement, rather than continuing to the profit target. I guess this means a price action entry where you place stops one pip under/above the recent low or high is not possible to test for.
Comment
-
The reason your stop keeps moving while in the OnBarUpdate() is because it is constantly submitting modifications to your stop price. If this is not intended behavior you need to also have a limiting condition that only submits your stop once at given price for your entry.Josh P.NinjaTrader Customer Service
Comment
-
For one, you could throw it with the condition for entry.
Code:if (some entry condition) { if (Position.MarketPosition == MarketPosition.Flat) { SetStopLoss(...); EnterLong(); } }
You may get some other ideas for other things you can do with this reference sample: http://www.ninjatrader-support.com/v...ead.php?t=3222Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bltdavid, 03-27-2023, 05:32 AM
|
18 responses
345 views
0 likes
|
Last Post
by ETFVoyageur
Today, 05:28 PM
|
||
Started by NM_eFe, Today, 05:15 PM
|
0 responses
2 views
0 likes
|
Last Post
by NM_eFe
Today, 05:15 PM
|
||
Started by vitaly_p, Today, 05:09 PM
|
0 responses
2 views
0 likes
|
Last Post
by vitaly_p
Today, 05:09 PM
|
||
Started by cmtjoancolmenero, Today, 05:05 PM
|
0 responses
1 view
0 likes
|
Last Post Today, 05:05 PM | ||
Started by lucasmelo152, 06-28-2021, 12:51 PM
|
8 responses
2,124 views
0 likes
|
Last Post
by Ymcapital
Today, 04:31 PM
|
Comment