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.

Reply
 
Thread Tools Display Modes
Old 08-16-2007, 08:11 PM   #1
Thomas
Member
 
Join Date: Aug 2007
Posts: 39
Thanks: 0
Thanked 0 times in 0 posts
Default Example of Auto Breakeven code?

1) I have the settings for my stop loss and targets as

SetStopLoss("", CalculationMode.Ticks, 12, false);
SetProfitTarget("", CalculationMode.Ticks, 12);

I can't seem to find the code to insert auto break even?

ie: go to breakeven after profit reaches 8 ticks.

Any help would be appreciated.

-------------------------------------------------------------------

2) During the backtesting process, when I insert times for my strategy to operate, I don't get any signals. When I remove the code
ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 1559
I then get the backtesting results? What am I doing wrong here?

Thanks in advance for any direction on these two matters.
Thomas is offline  
Reply With Quote
Old 08-17-2007, 12:10 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

1) Unfortunately AutoBreakEven is not support on NinjaScript strategies only.
2) I suggest adding Print() statements to your logic to see where it breaks.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 08-17-2007, 01:29 PM   #3
Thomas
Member
 
Join Date: Aug 2007
Posts: 39
Thanks: 0
Thanked 0 times in 0 posts
Default

[quote=NinjaTrader_Dierk;14474]1) Unfortunately AutoBreakEven is not support on NinjaScript strategies only.
quote]

1) Will auto break-even be an option on "NS strategies only", in the near future?

2) Do I need to program in an ATM custom to get an auto break-even aspect to the strategy?

3) If so, can I combine the custom ATM with other NS exit/profit target strategies? For simplistic sake, could I have a custom ATM and a simple "cross above..." strategy as the exits. If any exit is filled then all orders would be cancelled?

Thanks in advance for your response.
Last edited by Thomas; 08-17-2007 at 01:33 PM.
Thomas is offline  
Reply With Quote
Old 08-17-2007, 02:32 PM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

1) No however, we will provide sample code to accomplish breakeven

2) No, you can program this with NinjaScript right now. We will have some reference samples available soon.

3) No you can not.
NinjaTrader_Ray is offline  
Reply With Quote
Old 08-17-2007, 03:39 PM   #5
Thomas
Member
 
Join Date: Aug 2007
Posts: 39
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks for your reply...I'll be looking forward to all of the new reference samples.
Thomas 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
Breakeven Trades pivot44 Miscellaneous Support 3 07-25-2007 01:32 PM
BreakEven Method MrBaffalo Strategy Development 2 04-16-2007 01:32 AM
Auto breakeven fails? nicko9 ATM Strategies (Discretionary Trading) 3 02-05-2007 03:04 AM
Auto breakeven fails? (2) nicko9 ATM Strategies (Discretionary Trading) 1 02-05-2007 01:36 AM
Sliding auto-breakeven pwald9 ATM Strategies (Discretionary Trading) 3 11-08-2006 06:45 AM


All times are GMT -6. The time now is 05:31 PM.