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 01-02-2007, 05:22 AM   #1
MAX
Senior Member
 
Join Date: Sep 2006
Location: Rome, , Italy
Posts: 131
Thanks: 2
Thanked 1 time in 1 post
Post imported post

I'm using the NT6 Beta version and I programmed a Signal that buy/sell limit and exit in stoploss or profit target. The thing I'd like, is to avoid the system to get again in position when a stoploss is generated.
In the attachment you can find an example.If, for instance, I'm long and my stoploss is 3 points below my entry point, maybe the 3 points is also the setup to buy limit, but it is not my intention to buy for example in a panic selling.
Below is the code I used to try to solve the trouble. Can you suggest me a solution if any)

Thanks.

Code:
if (Position.MarketPosition != MarketPosition.Long)
 
 {
EnterLongLimit(CTR, DonchianChannel(LEN).Lower[1], "Buy Limit");
Attached Files
File Type: zip CodeA.zip (68.2 KB, 16 views)
MAX is offline  
Reply With Quote
Old 01-02-2007, 05:41 AM   #2
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
Post imported post

Max,

When running the backtest, do you set Entries per direction= 1 in the strategy dialogue window along with Entry handling = AllEntries?

Ray


NinjaTrader_Ray 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


All times are GMT -6. The time now is 07:15 AM.