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 > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 10-10-2011, 11:23 AM   #1
hawkfx
Junior Member
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default Change Entry Price

Hello.

I am very new to ninjatrader and ninjascript, I want to automate an strategy, it is a fast scalper, I set EnterShortStop and EnterLongStop few Ticks behind Bid/Ask price, but sometimes if price goes away, I need to change the entry price how can I achive that? I have to cancel the order and open another?


Ohter question, the SetStopLoss is only for Long and Short orders? Can't be set to LongStop and ShortStop?

I am trying to achive what I do on mql

Thanks
hawkfx is offline  
Reply With Quote
Old 10-10-2011, 11:31 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello hawkfx,

Welcome to NinjaTrader. If you want to change price only, you do not need to cancel and resubmit separately. If everything is the same (direction, quantity, order type, signal name) except for price, then you just resubmit with the new price and the order is modified.

SetStopLoss can be used to protect long and short positions. It will automatically place the right order depending on the direction of the trade. There are also dedicated methods for ExitLongStop() and ExitShortStop() that provide for more order control.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 10-10-2011, 11:44 AM   #3
hawkfx
Junior Member
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default

I have another question, how can I iterate all pending orders I have working?

I mean I want to send X amount of longstop or shortstop orders (different or same prices, but different signal name).

So I want to do it something like this:

for(i = 0; i < totalpending; i++) {
//get entry price, signal name, etc
}

how can I do it?
hawkfx is offline  
Reply With Quote
Old 10-10-2011, 11:58 AM   #4
sandeshrai
Member
 
Join Date: Jan 2010
Location: Irvine, CA
Posts: 58
Thanks: 12
Thanked 0 times in 0 posts
Default

How do I start a new thread. Is the only way to raise a question through replying to a new thread?
sandeshrai is offline  
Reply With Quote
Old 10-10-2011, 12:02 PM   #5
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

hawkfx,

We do not support accessing an orders collection directly. To access values about pending orders, you have to work with IOrder objects and advanced framework. You can see here for properties you can expose about orders:
http://www.ninjatrader.com/support/h...nt7/iorder.htm

This sample can help get you started working with these advanced strategy items:
http://www.ninjatrader.com/support/f...ead.php?t=7499

sandeshrai,
Welcome to the NinjaTrader forums. To create a new thread, click the forum category you want to post in, and then click the New Thread button.
NinjaTrader_RyanM 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
Price Change carlton Charting 1 07-26-2011 09:37 AM
Change Limit Price RogBear Automated Trading 2 07-20-2011 08:57 PM
SampleATMStrategy Order Entry Change cre8it8 Strategy Development 2 07-16-2010 02:18 PM
ATM strategies: signal price instead of average entry price mario73 ATM Strategies (Discretionary Trading) 1 01-02-2009 02:49 AM
How to make the price ladder stop moving when no change in price Trinity Miscellaneous Support 1 08-02-2006 07:41 PM


All times are GMT -6. The time now is 10:15 PM.