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 2,013 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?
$4.5M Floods Russia Nuclear Contract in 24 Hours -- Krem …
Prediction Markets & Event Contracts
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
White House Drops First Alien Files Today -- Market Says …
Prediction Markets & Event Contracts
I Have a Thing Called Iran -- Trump Stays in DC as Airsp …
Prediction Markets & Event Contracts
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
1 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,758 since Jun 2009
Thanks Given: 3,828
Thanks Received: 4,644


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)
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,577

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