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,432 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Is there a way to do this?

  #1 (permalink)
 
richw's Avatar
 richw 
Salt Lake City, UT
 
Experience: Advanced
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL, ES, NQ, YM
Posts: 1,809 since May 2010
Thanks Given: 2,246
Thanks Received: 1,541

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?
Ninja Trader 8 Drawing Tools Wanted
NinjaTrader
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Looking for an MQL4 MetaTrader programmer/coder
The Elite Circle
Request for MACD with option to use different MAs for fa …
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
48 thanks
NexusFi site changelog and issues/problem reporting
46 thanks
Battlestations: Show us your trading desks!
33 thanks
GFIs1 1 DAX trade per day journal
32 thanks
Friendly challenge question to vendors
18 thanks

  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,761 since Jun 2009
Thanks Given: 3,823
Thanks Received: 4,629


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 Twitter Reply With Quote
The following user says Thank You to sam028 for this post:
  #4 (permalink)
 
richw's Avatar
 richw 
Salt Lake City, UT
 
Experience: Advanced
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL, ES, NQ, YM
Posts: 1,809 since May 2010
Thanks Given: 2,246
Thanks Received: 1,541

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,319 since Jun 2009
Thanks Given: 33,139
Thanks Received: 101,473

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 Twitter Visit my NexusFi Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
  #6 (permalink)
 
richw's Avatar
 richw 
Salt Lake City, UT
 
Experience: Advanced
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL, ES, NQ, YM
Posts: 1,809 since May 2010
Thanks Given: 2,246
Thanks Received: 1,541

I will try that suggestion.

Visit my NexusFi Trade Journal Started this thread Reply With Quote





Last Updated on February 26, 2011


© 2024 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 - Privacy Policy - Downloads - Top
no new posts