![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
Hi:
If I enter a long position, I can send a message via the following: If condition met, Enter Long() SendMail() How do I do the same if the Profit Target or Trail Stop is executed ? i.e. If Profit Target Reached, SendMail() I am struggling to understand how I can ascertain how Profit Target is Reached via the strategy. thx David |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
You would have to get creative and check several things such as position size and realized PnL, maybe the trades collection.
There is no simple approach to this at this time. NT 6.5 will make this easier.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
Your right - thx. I can use the Expected PnL to ascertain whether the Profit Target is hit.....trailing stop requires a little more creativity though.
thx David |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
by the way when is NT 6.5 being released ? thx
|
|
|
|
|
|
#5 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Fall time frame.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
Hello.
How is it possible (by whatever means) to track when a dynamic Trailing Stop exit has been executed (using SetTrailStop in OnBarUpdate). One can track the 'Value' of the TrailStop ...... I believe it reaches a minimum value of 1 and if the price moves down by one tick (long trade) then the trail stop will be executed. If the value went to zero it would be easy, i.e if (Value=0) do the following......... any ideas or pointers would be greatly appreciated. thx DAvid |
|
|
|
|
|
#7 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
You can do this with NT6.5 and track order status changes. Just be patient for a few more weeks.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
The only thing you can do right now is monitor the strategy's position.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
thx guys --- thought so.
any concrete dates for the NT6.5 release ? thx DG |
|
|
|
|
|
#10 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
A few weeks from now until first beta. No ETA on release.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
Hi
A couple of weeks I submitted the following as part of this thread: ****************************************** Hello. How is it possible (by whatever means) to track when a dynamic Trailing Stop exit has been executed (using SetTrailStop in OnBarUpdate). One can track the 'Value' of the TrailStop ...... I believe it reaches a minimum value of 1 and if the price moves down by one tick (long trade) then the trail stop will be executed. If the value went to zero it would be easy, i.e if (Value=0) do the following......... any ideas or pointers would be greatly appreciated. thx DAvid *********************************** Can I assume that this is now possible with the new Beta version of NT. If so, & CalculateOnBarClose=True, would the execution happen in real time still (like it tyipcally does for SetTrailStop) or would the execution happen OnBarClose? many thx in advance David |
|
|
|
|
|
#12 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Yes, see the NT 6.5 Beta Help Guide, OnOrderUpdate() method. This stuff is for experienced programmers and we will roll out reference samples in time. One already exists here -
http://www.ninjatrader-support.com/v...ead.php?t=3917
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
thx Ray - regarding the second question..... if CalculateOnBarClose=True, does the OnOrderUpdate() method update in real time? i.e. not only update On Bar Close.
thx DAvid |
|
|
|
|
|
#14 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#15 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
Ray
Now i am confused..... this is some of the text in the reference sample: The OnOrderUpdate() method is updated whenever the state of an order changes which allows you to submit and control your stop-loss and profit target orders the instant your entry order is filled. Now a TrailStop updates on every tick (i.e. new order for every up tick on a trailing stop) even if CalculateOnBarClose = True. This appears to conflict with your last statement...... pls advise. thx |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Profit Target Suggestion | RicTessitore | Suggestions And Feedback | 5 | 07-23-2009 09:42 AM |
| profit target - no stop | Futures_Shark | Suggestions And Feedback | 1 | 08-14-2007 10:51 PM |
| Default stop loss and profit target as GTC | equitydealer | General Programming | 4 | 06-18-2007 11:31 PM |
| Auto Trail Stop Loss Didn't Trigger | Jappenzeller | ATM Strategies (Discretionary Trading) | 5 | 03-12-2007 07:39 AM |
| Adding more cars messes up Profit Target and Stop | Nelson1980 | Miscellaneous Support | 1 | 05-17-2006 04:16 AM |