Go Back   NinjaTrader Support Forum > NinjaTrader 8 > Platform Technical Support

Platform Technical Support General platform technical support for NinjaTrader 8.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 06-19-2017, 10:54 AM   #1
barabba
Member
 
Join Date: Jan 2008
Posts: 41
Thanks: 7
Thanked 1 time in 1 post
Default Programmatically set trade size in discretionary trading

Hello, I would like to know if there is a way (any kind of way, from setting parameters to coding a platform extension) to accomplish a simple task.

I would like to:

1) on a stock chart, manually enter an order to open a position, with an ATM strategy already selected and active

2) override the trade size by invoking some code that, before sending the order to the broker, changes the order size according to some logic (e.g. calculating number of shares based on current volatility)

Is this possible?

Thank you.
barabba is offline  
Reply With Quote
Old 06-19-2017, 12:03 PM   #2
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 7,634
Thanks: 119
Thanked 1,697 times in 1,599 posts
Default

Hello barabba,

If the script itself was placing the orders (via button press or other action) this would possible to achieve as the script could set the quantity before the order is placed.
http://ninjatrader.com/support/forum...php?linkid=697

However, I am not aware of a way to stop an order from being placed so that it may be modified.

The Account tools would allow to for a trigger any time an order is placed or the position changes etc, but this would be after the order is already submitted. You could send a ChangeOrder() for the existing order after its been placed.
http://ninjatrader.com/support/helpG...rderupdate.htm
http://ninjatrader.com/support/helpG...ount_class.htm
NinjaTrader_ChelseaB is offline  
Reply With Quote
The following user says thank you to NinjaTrader_ChelseaB for this post:
Old 06-20-2017, 10:15 AM   #3
barabba
Member
 
Join Date: Jan 2008
Posts: 41
Thanks: 7
Thanked 1 time in 1 post
Default

I'm experimenting with the strategy script you provided in your previous message. The script places two buttons on the chart, and it is good to open manual trades with calculated number of shares.

The problem is that this strategy script is no longer active when I close and reopen ninja trader. I have a 4k monitor with more than 30 charts opened, and I have to manually reactivate the strategy on each chart each time ninja trader is restarted.

Is there a way to keep the strategy active between ninja trader restarts?
barabba is offline  
Reply With Quote
Old 06-20-2017, 11:18 AM   #4
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 7,634
Thanks: 119
Thanked 1,697 times in 1,599 posts
Default

Hello barabba,

No, there is not a way to have a fully automated NinjaScript Strategy automatically enable itself and start trading when starting NinjaTrader.

You could make an indicator that has the same functionality using an account object to generate the order. This would be more complex to achieve.
http://ninjatrader.com/support/helpG...reateorder.htm
http://ninjatrader.com/support/helpG...-us/submit.htm
http://ninjatrader.com/support/helpG...ount_class.htm

Below is an example that is in an Addon, though the code that actually sends the order (the Atm Strategy part being optional) would be the same.
http://ninjatrader.com/support/forum...273#post487273
NinjaTrader_ChelseaB is offline  
Reply With Quote
The following user says thank you to NinjaTrader_ChelseaB for this post:
Old 06-21-2017, 04:29 AM   #5
barabba
Member
 
Join Date: Jan 2008
Posts: 41
Thanks: 7
Thanked 1 time in 1 post
Default

Thank you for your answer. I'll try with an indicator.

However, I'm surprised to hear that automatic strategies always have to be enabled manually... is this what algorithmic traders do? Where is the "automatic" of automation?

Even in that simple MT4 platform it's possible to keep strategies active between restarts. I believe this should be a trader's choice.
barabba is offline  
Reply With Quote
Old 06-21-2017, 07:30 AM   #6
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 7,634
Thanks: 119
Thanked 1,697 times in 1,599 posts
Default

Hello barabba,

The automation comes from the entries and exits that are controlled by code instead of semi automated the way Atm Strategies require a manual order to begin working.

I have submitted a feature request on your behalf for the NinjaTrader Development to consider allowing strategies to automatically become enabled upon connection in a future version of NinjaTrader.

Once I have a tracking ID for this request I will forward this to you for future reference.
NinjaTrader_ChelseaB is offline  
Reply With Quote
The following user says thank you to NinjaTrader_ChelseaB for this post:
Old 06-21-2017, 03:13 PM   #7
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 7,634
Thanks: 119
Thanked 1,697 times in 1,599 posts
Default

Hello barabba,

I have received a tracking ID for your request.

For future reference, your request to for NinjaTrader to re-enable strategies on startup which were enabled at the time of the last shut down is being tracking with ID #SFT-937.

Please note it is up the NinjaTrader Development to decide if and when a request will be implemented.

Thank you for your feedback. Please let me know of any other suggestions you have for the NinjaTrader platform.
NinjaTrader_ChelseaB is offline  
Reply With Quote
The following user says thank you to NinjaTrader_ChelseaB for this post:
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
discretionary trading 2 accounts simultaneously jammy page Platform Technical Support 2 04-06-2016 05:57 AM
How to import my discretionary trade into chart from trade history text file babyjinja Platform Technical Support 4 06-03-2015 05:13 AM
Semi-Discretionary Trading spikebuck77 Platform Technical Support 2 05-18-2011 12:07 AM
Semi discretionary trading with ninjatrader? atrader123 Platform Technical Support 1 11-22-2010 01:46 PM
auto trading vs discretionary trading and limit orders John Sanders Platform Technical Support 3 11-07-2007 09:03 AM


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

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.