I'm trying to set it up so that the order itself has a stop loss breakeven based on itself.
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 break even
Collapse
X
-
Stop loss break even
In the sample on protecting the order position, it seems the stop loss break even is done using the Position.AvgFillPrice.. How is that different from basing it on the order's avg fill price? And if you were to do that wouldn't you set that in the OnExecution() event, rather than the OnbarUpdate() event?
I'm trying to set it up so that the order itself has a stop loss breakeven based on itself.Tags: None
-
If your strategy only has one active entry at a time Position.AvgPrice is not different than order's avg fill price. Discrepancies can arise if you have two long entry orders both with filled positions. Then Position.AvgPrice becomes the avg price between those two orders.
The reason it is in OnBarUpdate() is because I don't want a breakeven stop loss right when my entry order is filled. I want the breakeven after my position has gained some ticks in profit.Josh P.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by NUVERSA, Today, 09:31 AM
|
0 responses
1 view
0 likes
|
Last Post
by NUVERSA
Today, 09:31 AM
|
||
Started by ttrader23, Yesterday, 09:04 AM
|
8 responses
37 views
0 likes
|
Last Post Today, 09:11 AM | ||
Started by tonynt, Yesterday, 01:48 PM
|
2 responses
12 views
0 likes
|
Last Post
by tonynt
Today, 09:01 AM
|
||
Started by goodknight777, Today, 08:43 AM
|
1 response
4 views
0 likes
|
Last Post Today, 08:53 AM | ||
Started by Salahinho99, 05-05-2024, 04:13 AM
|
5 responses
47 views
0 likes
|
Last Post Today, 08:51 AM |
Comment