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 sam028 with 1 posts (1 thanks)
    3. looks_3 Big Mike with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 1,437 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?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Deepmoney LLM
Elite Quantitative GenAI/LLM
ZombieSqueeze
Platforms and Indicators
Futures True Range Report
The Elite Circle
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
Battlestations: Show us your trading desks!
26 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
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
Thanked by:
  #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,396 since Jun 2009
Thanks Given: 33,172
Thanks Received: 101,534

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
Thanked by:
  #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