PDA

View Full Version : Plot StopLoss and ProfitTarget


Oil_Trader
09-18-2010, 05:08 PM
I am looking to plot this data in realtime. Where do I get these figures? Which object do i Call?

NinjaTrader_Josh
09-18-2010, 08:26 PM
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.

Oil_Trader
09-19-2010, 02:48 PM
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]);

NinjaTrader_Josh
09-19-2010, 09:15 PM
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.

Oil_Trader
09-19-2010, 09:18 PM
Yes but I need the execution price at Close[0]...how do I set that for the indicator value?

NinjaTrader_Josh
09-19-2010, 09:55 PM
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/forum/showthread.php?t=6651