NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > ATM Strategies (Discretionary Trading)

ATM Strategies (Discretionary Trading) Support for Advanced Trade Management, AutoTrail, AutoBreakeven, Stop Strategy and Simulated Stops etc...

Reply
 
Thread Tools Display Modes
Old 01-19-2009, 07:55 AM   #1
clint2008
Member
 
Join Date: Sep 2008
Posts: 62
Thanks: 0
Thanked 0 times in 0 posts
Default Submitting stoploss order how to set parameter Stops&Targetsubmission

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?
clint2008 is offline  
Reply With Quote
Old 01-19-2009, 08:06 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

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.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-19-2009, 10:50 AM   #3
clint2008
Member
 
Join Date: Sep 2008
Posts: 62
Thanks: 0
Thanked 0 times in 0 posts
Default

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?
clint2008 is offline  
Reply With Quote
Old 01-19-2009, 12:10 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Unfortunately this is not supported.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-19-2009, 11:18 PM   #5
clint2008
Member
 
Join Date: Sep 2008
Posts: 62
Thanks: 0
Thanked 0 times in 0 posts
Default

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.
clint2008 is offline  
Reply With Quote
Old 01-20-2009, 07:13 AM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

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.
NinjaTrader_Josh 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
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


All times are GMT -6. The time now is 03:09 AM.