![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jun 2009
Posts: 740
Thanks: 19
Thanked 14 times in 9 posts
|
Hello,
when working with auto-strategies it occurs that I need to move stoplosses. It happened today that I moved stoploss but few seconds later the stoploss was pulled back to the posiiton from where I moved it away. Does this happen wiht setstoploss and using a strategy? Or when using settrailstop? Or isnīt it possible anyway to move the stoploss of the strategy? If so, what is the reaction time that the stoploss(es) is/are pulled back? Thanks Tony |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hi Tony,
How are you moving stop losses? Through code or manually in a different chart or order entry screen?
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jun 2009
Posts: 740
Thanks: 19
Thanked 14 times in 9 posts
|
Hello Ryan,
thank you for your prompt reply - great support as usual with NinjaTrader! The stoploss is defined in the strategy (initial stoploss and then move to entry price eg after 90 ticks). But when price is in my direction I want to pull stoploss manually closer to actual price for not giving back profits when price falls back to entry-price. I can move with chart-trader but few seconds later it moves back "from ghost-hand" to where I took it away. Best Tony |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
The strategy code will continue to set the value of the stop loss, even if you manually move it. If you want manual adjustments to stop losses after an automated entry, you can use the NinjaScript > ATM model for this.
http://www.ninjatrader.com/support/h...strategies.htm
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jun 2009
Posts: 740
Thanks: 19
Thanked 14 times in 9 posts
|
Thank you!
|
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jun 2009
Posts: 740
Thanks: 19
Thanked 14 times in 9 posts
|
Ryan,
it seems that only ATM-strategies (like to "build" in chart-trader) can be moved stoplosses? Or also strategies with conditions created in strategy-analyzer? Thanks Tony |
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Strategies will set the level of stop loss orders, unless you integrate an ATM strategy into the NinjaScript strategy.
The use model for creating an ATM Strategy within a NinjaScript Strategy is when you want to programmatically monitor and generate an entry signal and then manualy manage the resulting open position via an ATM Strategy in one of NinjaTrader's order entry windows.
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Jun 2009
Posts: 740
Thanks: 19
Thanked 14 times in 9 posts
|
So, I understand that I can code in the strategy that the stoplosses are managed by ATM-strategy (so that I can move the stoplosses with chart-trader, which I couldnīt do when stoplosses managed by strategy) and the exit-conditions (NOT profit-targets, as in this case I could do all as ATM and donīt need a strategy) work with the coded strategy.
Is that right or some misunderstanding on my end? And if so do you have a sample how to do ATM-strategy within a coded strategy (like your samplepricemodification or samplemultiinstrument....)? Thanks Tony
Last edited by tonynt; 06-03-2011 at 01:27 PM.
Reason: typing error
|
|
|
|
|
|
#9 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Yes, your understanding is correct. The ATM sample is built into the platform. Click Tools > Edit NinjaScript > Strategy > SampleAtmStrategy
http://www.ninjatrader.com/support/h...strategies.htm
Ryan M
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_RyanM for this post: |
|
|
|
#10 |
|
Senior Member
Join Date: Jun 2009
Posts: 740
Thanks: 19
Thanked 14 times in 9 posts
|
Hi Ryan,
thanks for all the support. Have a great weekend! Another hint at this opportunity - if posts would be assorted most recent post at bottom (I think this occurs sometimes in threads) then this makes it more easier and faster to reply as one doesnīt need to scroll up where last post is to answer correctly. Best Tony |
|
|
|
|
|
#11 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Thanks, Tony. I agree and have set up my forum display to work this way.
Click User CP on the forum toolbar. Edit Options Under Thread Display Mode, change to Linear - Oldest first. Hope that trick helps you out. Thanks - Have a great weekend!
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#12 |
|
Senior Member
Join Date: Jun 2009
Posts: 740
Thanks: 19
Thanked 14 times in 9 posts
|
Hi Ryan,
sorry for asking again now;-) The ATM-strategies are easy to do, also strategy-development and coding is easy already. But how can I join both? Checking the sampleatmstrategy I donīt see where I can code my exit conditions. Sorry! Thanks Tony
Last edited by tonynt; 06-03-2011 at 03:34 PM.
Reason: wrong translation into english
|
|
|
|
|
|
#13 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
It's similar. Define your exit conditions but then use the AtmStrategyClose() method instead of ExitLong, ExitShort.
http://www.ninjatrader.com/support/h...ategyclose.htm http://www.ninjatrader.com/support/h...gy_methods.htm
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Jun 2009
Posts: 740
Thanks: 19
Thanked 14 times in 9 posts
|
Hi Ryan,
sorry for causing some misunderstanding - already midnight here;-) What I mean is not - if I understand right your reply - how to manage the ATMStrategyClose but I mean * WHERE to code the exit conditions in the strategy - not with ATM as I want to have exits with conditions and not fixed profittargets as in ATM? (in help guide using atm strategies there is not a sample how to do the exits - or are the "strategy-coded-exits" not important and not referred by the ATM? * which strings in the sampleatmstrategy (eg) are "samples" and which are the core and necessary to join with an ATM? I canīt understand this sample as there are no "normal" entries and exits defined. Isnīt there another sample? Thanks Tony
Last edited by tonynt; 06-03-2011 at 04:35 PM.
Reason: correction question
|
|
|
|
|
|
#15 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
The sample has a lot to it and most all of it is required for a working NS > ATM solution. About the only part that is not required is the change stop target block.
The entry condition is simple: Close[0] > Open[0] The sample does not have explicit exit conditions. The only exits are determined by the target and stop loss defined within the ATM strategy. You can define your own exits conditions if you want, and use the AtmStrategyClose() call to programatically close an ATM strategy. Since there's a lot to it, you should try first to get it submitting orders with a simple ATM strategy attached. Once things work as you expect, add additional layers of complexity like separate exit conditions.
Ryan M
NinjaTrader Customer Service
Last edited by NinjaTrader_RyanM; 06-03-2011 at 04:50 PM.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to supersede Ninja ProfitTargets and StopLosses | kenb2004 | Strategy Development | 7 | 01-28-2011 02:57 PM |
| backtesting trailing stoplosses | Eddy-2d | Strategy Analyzer | 3 | 02-03-2010 08:27 AM |
| Move Chart | velocity | NinjaScript File Sharing Discussion | 3 | 01-30-2010 02:10 AM |
| Move to breakeven | mballagan | Strategy Development | 18 | 05-18-2009 12:53 PM |
| Being able to move up and down on the chart | Mike_32 | Suggestions And Feedback | 1 | 11-21-2008 07:22 AM |