![]() |
|
|||||||
| 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: 747
Thanks: 23
Thanked 14 times in 9 posts
|
Hello,
when there is a trade with eg 3 lots entered by calling a chart-trader-ATM from a NT-script-strategy can the exits of these positions be handled within the strategy like the entries would have been realized with NT-script? In the helpguide there is only the exit with unrealizedprofitloss but not with ticks or variables. Can the exit only be done with Target from ATM-chart-trader or also be handled like in a script eg if (GetCurrentAsk(0) < Position.AvgPrice - 80 * TickSize) ExitShort(1000, "SX2","S2");" Thanks ![]() Tony |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
tonynt,
Could you please clarify what you mean? Are you wanting to monitor stop losses, etc. outside of the ATM strategy code? You can use the following methods for handling orders within an ATM strategy. http://www.ninjatrader.com/support/h...gy_methods.htm Please let me know if I may assist further.
Adam P.
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Jun 2009
Posts: 747
Thanks: 23
Thanked 14 times in 9 posts
|
Adam,
in a NT-script-strat I do an entry with 3 lots from Chart-Trader-ATM. This is because I want to move the stops in my script-strat during the trade (beside my conditions there- if necessary). And I do not work with profit-targets as OCO. In my script-strats I do my exits as I have mentioned above eg for my 2nd short lot with "if (GetCurrentAsk(0) < Position.AvgPrice - 130 * TickSize) ExitShort(1000, "SX2","S2");" How can one do in the script-strat the exit of the 3 positions coming from ATM-chart-trader please? (There are no profit-targets for the positions as I never want to have a bracket on brokers-server after internet outage August, 2010 and I do the "targets" as mentioned above. So how can I do this when the entries are not coming from the script but from ATM-chart-trader) I hope I could explain now better. Thanks Tony Quote:
Last edited by tonynt; 11-16-2011 at 03:25 PM.
Reason: typing error
|
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
tonynt,
You can use the AtmStrategyClose() method along with the AtmStrategyRealizedProfitLoss() method to exit your trades at predefined levels. PNL : http://www.ninjatrader.com/support/h...edprofitlo.htm Close Strategy : http://www.ninjatrader.com/support/h...ategyclose.htm Please let me know if I may assist further.
Adam P.
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Jun 2009
Posts: 747
Thanks: 23
Thanked 14 times in 9 posts
|
Adam,
this works with PL but not with variables, no? But if I do it this way and calculating the PL how can I refer to each of the 3 positons? Thanks Tony Quote:
|
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
TonyNT,
For that you would need to use AtmStrategyChangeStopTarget() For more information, please see the following : http://www.ninjatrader.com/support/h...stoptarget.htm
Adam P.
NinjaTrader Customer Service |
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Jun 2009
Posts: 747
Thanks: 23
Thanked 14 times in 9 posts
|
Adam,
of course I can use STOP. But there is no TARGET (because no target is defined in the ATM-Charttrader - to avoid brackets on brokers server). Or do you mean "TARGET2" is linked per default with "STOP2" maybe? In the meantime I did testing and I had same range-size a script with "direct entry" and a script with "entry from chart-trader-ATM. It occurs that entry by the strategy working with charttrader is sometime only next bar. Can this occur - time delay? Thanks Tony Quote:
|
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,547
Thanks: 261
Thanked 1,012 times in 993 posts
|
Tony, if you have no profit target defined that's fine, STOP2 refers to the stop value of the second target stop price.
The entry is done whenever the conditions you programmed evaluate to 'true' - with CalculateOnBarClose = true the earliest entry is the next bar. If you run the script on 'false' it can enter intrabar as well.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Internal Order Handling w/ 2 Exit Orders | Gumby | Strategy Development | 4 | 07-11-2011 02:05 PM |
| Exit on Close with Advanced Order Handling | dbw451 | Strategy Analyzer | 3 | 01-27-2009 09:43 AM |
| ATM from script | MelbourneRich | Automated Trading | 1 | 09-19-2008 09:38 AM |
| ninja script strategy exit | grav_rat | Automated Trading | 2 | 04-20-2008 04:19 PM |
| Handling of Exit Long and Exit Short before EOD | Trader Rob | Strategy Development | 3 | 10-22-2007 02:13 PM |