NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

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.

Reply
 
Thread Tools Display Modes
Old 09-18-2010, 05:08 PM   #1
Oil_Trader
Senior Member
 
Join Date: Aug 2010
Location: http://twitter.com/Oil_Trader
Posts: 141
Thanks: 0
Thanked 0 times in 0 posts
Default Plot StopLoss and ProfitTarget

I am looking to plot this data in realtime. Where do I get these figures? Which object do i Call?
Oil_Trader is offline  
Reply With Quote
Old 09-18-2010, 08:26 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Oil_Trader,

The Set() methods do not return IOrder objects. To track where they are you would need to create your own variable to match their values right as you submit the Set() method. So for instance if the Set() value is 10 ticks below entry price, you can create your own double variable and have it equal to Position.AvgPrice - 10 * TickSize.
NinjaTrader_Josh is offline  
Reply With Quote
Old 09-19-2010, 02:48 PM   #3
Oil_Trader
Senior Member
 
Join Date: Aug 2010
Location: http://twitter.com/Oil_Trader
Posts: 141
Thanks: 0
Thanked 0 times in 0 posts
Default

How do I pass the close[0] value back to the "plotline indicator" when the price was triggered?


Can i place this inside the OnBarUpdate within the strategy?


Line.Set(Close[0]);
Last edited by Oil_Trader; 09-19-2010 at 02:51 PM.
Oil_Trader is offline  
Reply With Quote
Old 09-19-2010, 09:15 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Not sure I follow what your requirement is to pass it back. If you want to set it, you should instead go to the indicator and modify the indicator logic to implement this directly.
NinjaTrader_Josh is offline  
Reply With Quote
Old 09-19-2010, 09:18 PM   #5
Oil_Trader
Senior Member
 
Join Date: Aug 2010
Location: http://twitter.com/Oil_Trader
Posts: 141
Thanks: 0
Thanked 0 times in 0 posts
Default

Yes but I need the execution price at Close[0]...how do I set that for the indicator value?
Oil_Trader is offline  
Reply With Quote
Old 09-19-2010, 09:55 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Oil_Trader,

You should not be setting values back to an indicator. The relationship should be one direction. If you absolutely need this type of logic, please see this reference sample: http://www.ninjatrader.com/support/f...ead.php?t=6651
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plot line for Stoploss billr Strategy Development 1 08-09-2010 01:36 PM
Get StopLoss/ProfitTarget from order symphys Strategy Development 5 05-24-2010 11:33 AM
Stoploss and Profittarget Problem thunderbolt78 General Programming 13 03-04-2010 05:14 AM
How to set ProfitTarget and Stoploss as (open price+x) and (open price -x) SuperDriveGuy Strategy Analyzer 4 03-19-2009 02:19 AM
ProfitTarget jriverac Strategy Development 8 05-06-2008 04:10 PM


All times are GMT -6. The time now is 07:20 PM.