NexusFi: Find Your Edge


Home Menu

 





I'm trying to print the values from an ArrayList


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one kaywai with 8 posts (0 thanks)
    2. looks_two NinjaTrader with 3 posts (1 thanks)
    3. looks_3 RJay with 1 posts (1 thanks)
    4. looks_4 traderwerks with 1 posts (0 thanks)
    1. trending_up 9,078 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 13 posts
    2. attach_file 1 attachments




 
Search this Thread
  #11 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,715 since May 2010
Thanks Given: 203
Thanks Received: 2,689


kaywai View Post
I change it like below, and I still don't know whether I'm getting anything into the ArrayList. Would you mind please helping?

 
Code

if (TDBuyExtendedSetupFX().buysetupmoveiscompleted)
{
 
drawtdstbuyline = true;
setuphigh = TDBuyExtendedSetupFX().hhbs;
TDSTBuy.Add(setuphigh);
if (TDSTBuy.Count > 2)
{
TDSTBuy.RemoveAt(0); //if TDSTBuy is filled, drop the oldest value
}
Console.WriteLine( "TDSTBuy" );
Console.WriteLine( " Count: {0}", TDSTBuy.Count );
Console.WriteLine( " Capacity: {0}", TDSTBuy.Capacity );
Console.Write( " Values:");
PrintValues(TDSTBuy);
}
}
publicstaticvoid PrintValues( IEnumerable TDSTBuy)
{
foreach (Object obj in TDSTBuy ) 
Console.Write(" {0}", obj);
Console.WriteLine();
}


I suggest adding some debug Print() statements at various points in your code to see what is being executed or not and taking it from there.


Follow me on X Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Daytrading to swingtrading
Traders Hideout
Thanks Mike. Godspeed.
The Elite Circle
Ninjatrader users - good CONNECTIONs post and article fr …
NinjaTrader
No book, only a stair: journaling fills where price move …
Cryptocurrency
Czechia Live at 52.5% as England Rides 4-2 Wave to Co-Fa …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 thanks
  #12 (permalink)
kaywai
singapore
 
Posts: 131 since Nov 2009
Thanks Given: 11
Thanks Received: 7

Hi,

I actually have some Print() statements which I omitted from the code. Which leads me back to my initial question, How do I print values from an ArrayList?

The code is fine upto " setuphigh = TDBuyExtendedSetupFX().hhbs;"

Beyond that, I'm not sure as I don't know how to print values from an ArrayList.

Would appreciate if you could help. I tried the code provided above but I get zero prints wrt the ArrayList in the output window.

Regards

Kay Wai



Reply With Quote
  #13 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 Vendor: www.innovative-trading-solutions-online.com 
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: ES
Posts: 687 since Jun 2009
Thanks Given: 765
Thanks Received: 789


for (idx = startpoint; idx < endpoint; idx++)

{
XXXX = arrayvalues[idx];
Print("idx = " + idx + " XXXX = " + XXXX);
}

Maybe you could cycle through the array values.

Just add the value to print with each idx value.


Reply With Quote
Thanked by:
  #14 (permalink)
kaywai
singapore
 
Posts: 131 since Nov 2009
Thanks Given: 11
Thanks Received: 7

Thanks Rjay!

Will see whether I can code what you suggested!

Kay Wai


Reply With Quote




Last Updated on May 13, 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