NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 12-07-2010, 03:28 PM   #1
kenb2004
Senior Member
 
Join Date: Jul 2010
Posts: 415
Thanks: 1
Thanked 4 times in 4 posts
Default How to change "Targets" and "StopLoss"

I have a strategy that when conditions are in an UpTrend buys with a "TrendBuy" and associated target and stoploss. I have another condition that says when "Trading" buy "TradeBuy" with associated target and stoploss. If my conditions change from Trending to Trading, how can I change the "TrendBuy" target and stop loss to "TradeBuy" target and stop loss?
Thanks

protected override void Initialize()
SetProfitTarget("TrendBuy",CalculationMode.Ticks, TargetTrendBuy);
SetStopLoss("TrendBuy", CalculationMode.Ticks, StopLossTrendBuy, false);
SetProfitTarget("TradeBuy",CalculationMode.Ticks, TargetTradeBuy);
SetStopLoss("TradeBuy", CalculationMode.Ticks, StopLossTradeBuy, false);

protected override void OnBarUpdate()
"Condition"
EnterLongLimit(DefaultQuantity, Close[0], "TrendBuy");
"Condition"
EnterLongLimit(DefaultQuantity, Close[0], "TradeBuy");
Last edited by kenb2004; 12-07-2010 at 03:30 PM.
kenb2004 is offline  
Reply With Quote
 

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
"ERROR: HISTBACKFILL "$INDU" Hdr: 400 Service FAILED " trader_rick1234 Version 7 Beta General Questions & Bug Reports 1 05-24-2010 08:01 AM
summary of "strategy realized" is not equal "account performance, total net profit"" Fragolino Miscellaneous Support 1 02-19-2009 04:12 AM
Please add "Calmar" and "Sterling" ratios to Performance._Trades.TradesPerformance Elliott Wave Suggestions And Feedback 2 06-10-2008 09:57 PM
"'OrderRejected'. Strategy has sent cancel requests" & "There is no market data..." Elliott Wave Strategy Development 6 04-12-2008 12:03 AM
Line "names" in Indicator Box change to "Line" after modification higler Charting 3 05-02-2007 06:05 AM


All times are GMT -6. The time now is 12:37 AM.