Variable strategy order quantity - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Variable strategy order quantity
Started:October 20th, 2013 (03:48 AM) by Astrogirl Views / Replies:895 / 2
Last Reply:October 20th, 2013 (09:04 AM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Variable strategy order quantity

Old October 20th, 2013, 03:48 AM   #1 (permalink)
Trading Apprentice
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, YM, NQ, FDAX
Astrogirl's Avatar
Posts: 49 since Oct 2013
Thanks: 25 given, 4 received

Variable strategy order quantity

Hello everyone!

The default quantity of my strategy is "1" but, in certain condition, i would change this value in "2".
What follows is the code I am actually using:

protected override void OnBarUpdate()
                // Change the order quantity value when the profit factor drow down a certain level
                if (Performance.AllTrades.TradesPerformance.ProfitFactor < profit_factor_limit)
                  DefaultQuantity = 2;
The matter is that it changes the default quantity of all trades and not only the one which respects the condition set...

Does anyone know why?

Reply With Quote

Old October 20th, 2013, 03:48 AM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Old October 20th, 2013, 09:04 AM   #3 (permalink)
Elite Member
London, UK
Futures Experience: Intermediate
Platform: NinjaTrader, Julia
Favorite Futures: Ockham's razor
gregid's Avatar
Posts: 636 since Aug 2009
Thanks: 311 given, 586 received

In your case you don't change the DefaultQuantity. Instead you simply ask for quantity in the EnterLong() or short or any other Order Method.
As in:
Use the official help guide for reference:
NinjaTrader Version 7

Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Variable strategy order quantity

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Order strategy ghl123 MultiCharts 2 July 23rd, 2013 04:42 AM
ATM Strategy: Limit order & stop loss order at the same time in the market? DrE6 NinjaTrader 2 June 21st, 2013 01:12 PM
Chart Trader and Order Quantity boss NinjaTrader Programming 2 August 28th, 2012 09:03 AM
Multiple time frame strategy sharing a variable ShruggedAtlas NinjaTrader Programming 7 February 17th, 2012 01:57 PM
How can I store the first order limit price as a variable to use for calculating... richwaters NinjaTrader Programming 2 February 22nd, 2011 02:58 PM

All times are GMT -4. The time now is 09:13 AM.

Copyright © 2016 by All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-27 in 0.08 seconds with 19 queries on phoenix via your IP