![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Sep 2006
Location: Rome, , Italy
Posts: 131
Thanks: 2
Thanked 1 time in 1 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");
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Max,
When running the backtest, do you set Entries per direction= 1 in the strategy dialogue window along with Entry handling = AllEntries? Ray
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|