![]() |
|
|||||||
| ATM Strategies (Discretionary Trading) Support for Advanced Trade Management, AutoTrail, AutoBreakeven, Stop Strategy and Simulated Stops etc... |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Sep 2008
Posts: 62
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
Programming a strategy that is having a delayed stoploss based on the value of an index rather than the future, this stoplossorder may or may not be executed. After a certain MFE I exit 1 contract and set the remaining contracts to BE. If I do that when I entered Stops&Targetsubmission by StrategyPosition than it works ok, but when the Stops&Targetsubmission is not set to StrategyPosition I see that the order is for all contract rather than the remaining. Can I set the parameter Stops&Targetsubmission within my strategy or should I switch my statements to change the stoploss first and then exit 1? |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
clint2008,
I guess I am confused as to what you are trying. Are you talking about an ATM strategy or a NinjaScript strategy? If you are from a NinjaScript strategy, in order for you to scale-out like that you need to scale-in with multiple entries first.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Sep 2008
Posts: 62
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for the quick reply. I'm working on Ninjascript Strategy.
So what I want to do is: EnterLong quantity 2 (no stoploss / no profittarget / no trailstop) after 40 ticks of profit -> ExitLong quantity 1 and SetStopLoss = Position.AvgPrice This SetStopLoss is now entered for quantity 2 in stead of 1 (the actual position) When I change Stops&TargetSubmission to By Strategy position the SetStopLoss is done for quantity 1; that is good. Now how can I set this parameter within my NinjaScript to make sure it is defaulted correct? |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Unfortunately this is not supported.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Sep 2008
Posts: 62
Thanks: 0
Thanked 0 times in 0 posts
|
I've tested a few things:
1) Rewrite of my script to enter unique entries -> that is working fine (scale in / scale out) however after all positions are closed (in the orders/excutions/positions tab) the strategyscript is still saying Position.Quantity = 1 and MarketPostion is not flat. That is unacceptable also. 2) I switched the ExitLong / SetStoploss statements to SetStoploss / Exitlong, so that the position was still at 2 when I changed the stoploss and then exit 1. But no difference, still ending up 1 position at the wrong side. Lots of orders after stop is hit. So the only way it works absolute correct is the parameter Stop & Targetsubmission by Strategyposition. You say that that is not supported. Is the usage of the parameter not supported or is changing the parameter from ninjascript not supported? I would really want some help if possible, I'm writing the script and a number of people have already told that they would love to use it when its ready. Scaling out a position is something everyone wants isn't it, so nothing strange there. But I only want to use supported options. |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
1. You need to debug your code and figure out why it is still open.
2. You are likely running into many Internal Order Handling Rules with your mixing of explicit exits and SetStopLoss. You need to be careful when you code this. Please review the rules at the bottom of this article and use TraceOrders = true to evaluate your code. http://www.ninjatrader-support.com/H...verview36.html Usage of a parameter is not supported.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| set profit...set stoploss | duck_CA | Strategy Development | 1 | 01-15-2009 03:02 AM |
| Submitting order to an active strategy id | whitmark | Automated Trading | 2 | 11-29-2008 08:07 AM |
| I can't introduce a stoploss order, help! | julen | Strategy Development | 3 | 09-10-2008 04:33 PM |
| Printing Current StopLoss & Profit Targets | Jim-Boulder | Strategy Analyzer | 1 | 06-25-2007 11:16 AM |
| Problem with 'Parameter Type' set to Price | codeye | Miscellaneous Support | 5 | 12-09-2005 07:06 AM |