NexusFi: Find Your Edge


Home Menu

 





Is there a way to do this?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one richw with 3 posts (0 thanks)
    2. looks_two Big Mike with 1 posts (1 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 sam028 with 1 posts (1 thanks)
    1. trending_up 1,928 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
richw's Avatar
 richw 
Salt Lake City, UT
Legendary Market Wizard in Training
 
Experience: Advanced
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL, ES, NQ, YM
Posts: 1,917 since May 2010
Thanks Given: 2,318
Thanks Received: 1,621

I want to be able to create a loop that will place X number of orders without having to enter each one separately.

 
Code

int x = 0;
double y = 0;
int z = 1;
while (x < 10)
{
_long1+x = EnterLongLimit(0, true, 1, _longFirstPrice-.05-y, "L"+z);
x = x + 1;
y = y + .05;
z = z + 1;
}


Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
South Korea Suspends Bithumb for Six Months Over AML Fai …
Cryptocurrency
Zytrade: Devin Brady, CEO - Ask Me Anything (AMA)
Brokers
Tradeify 3.0 Overhauls Futures Prop Firm Model -- One-Ti …
Funded Trading Evaluation Firms
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
Post-Summit Scorecard: $36M in May 15 Bets Settle Near-Z …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632


Yes, but your EnterLongLimit() syntax is false, in this case it's more:
 
Code
                            
EnterLongLimit(1_longFirstPrice-.05-y"L"+z.ToString()) 

and you should use for() loops instead of while().


Success requires no deodorant! (Sun Tzu)
Follow me on X Reply With Quote
Thanked by:
  #4 (permalink)
 
richw's Avatar
 richw 
Salt Lake City, UT
Legendary Market Wizard in Training
 
Experience: Advanced
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL, ES, NQ, YM
Posts: 1,917 since May 2010
Thanks Given: 2,318
Thanks Received: 1,621

What about the very beginning? Is there a workaround to enable a variable in the IOrder object? That seems to be the most troublesome part.

 
Code
_long1+x = EnterLongLimit(0, true, 1, _longFirstPrice-.05-y, "L"+z);


Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557

Create an array and then increment it during the loop to store the IOrder.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
 
richw's Avatar
 richw 
Salt Lake City, UT
Legendary Market Wizard in Training
 
Experience: Advanced
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL, ES, NQ, YM
Posts: 1,917 since May 2010
Thanks Given: 2,318
Thanks Received: 1,621

I will try that suggestion.


Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on February 26, 2011


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts