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 03-13-2007, 12:12 AM   #1
Nathamus
Member
 
Join Date: Feb 2007
Location: Germany
Posts: 37
Thanks: 1
Thanked 0 times in 0 posts
Post imported post

Hello!

To enter Long positions with Limit orders using Quantity, Price and Signal Name
I can use the following order

Code:
EnterLongLimit(int quantity, double price, string signalName);
I wounder if there is a simmilar overload for the ExitLongLimit? I cannot find it. I would like to place the following order:

Code:
ExitLongLimit(int quantity, double limitPrice, string SignalName);
But I can only place:

Code:
ExitLongLimit(int quantity, double limitPrice, string SignalName, string fromEntrySignal);
and

Code:
ExitLongLimit(int quantity, double limitPrice, string fromEntrySignal);
As a result I cannot identify the source of a sell Limit Order on the order page.

My strategy creates lots of orders. For debugging purpose I need to identify which ExitLongLimit order was executed in a spefic situation. When I take a look at the Order Page all ExitLongLimit orders are identified as "sell" orders.

Any ideas? Is there a possibility to customize the order type overloads?

thx
Nathamus is offline  
Reply With Quote
Old 03-13-2007, 02:24 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

Why can't you use?







ExitLongLimit(int quantity, double limitPrice, string SignalName, string fromEntrySignal);
When fromEntrySignal is the signal you provided in EnterLongLimit() ?

Ray
NinjaTrader_Ray is offline  
Reply With Quote
Old 03-13-2007, 03:37 AM   #3
Nathamus
Member
 
Join Date: Feb 2007
Location: Germany
Posts: 37
Thanks: 1
Thanked 0 times in 0 posts
Post imported post

Because I cannot be sure which entry signal created the current situation / the current amount of shares.

Depending on the current situation different market entry ordersare created with a variable number of shares. Let's say if the market is above a yesterdays close+x buy 10 "buy_in_high", if it is in between close+10 and close-10 buy 3 "buy_in_mid" and if it is below close-10 buy 1 "buy_in_low". Then I buy an sell at certain levels ("buy_one_at_z", "sell_one_at_y", ... etc.). So a ExitLongLimit order could exit one shares of the position I initially bought to enter the market, or it could exitone shares Iadded later.
Nathamus is offline  
Reply With Quote
Old 03-13-2007, 03:39 AM   #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
Post imported post

I see.

Try this, I believe it should work:

ExitLongLimit(quantity, limitPrice, "MyExitName", string.empty);


Ray
NinjaTrader_Ray is offline  
Reply With Quote
Old 03-13-2007, 04:09 AM   #5
Nathamus
Member
 
Join Date: Feb 2007
Location: Germany
Posts: 37
Thanks: 1
Thanked 0 times in 0 posts
Post imported post

That works perfect, thanks for the tip.

Nathamus



PS: You have to write empty with capital E, otherwise it won't compile.

Code:
ExitLongLimit(quantity, limitPrice, "MyExitName", string.Empty);
Nathamus is offline  
Reply With Quote
Old 03-13-2007, 04:14 AM   #6
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

You correct, thanks for pointing it out.
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 12:25 AM.