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 6,787 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 13 posts
    2. attach_file 1 attachments




 
Search this Thread

I'm trying to print the values from an ArrayList

  #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,714 since May 2010
Thanks Given: 203
Thanks Received: 2,686


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 Twitter Reply With Quote

Can you help answer these questions
from other members on NexusFi?
About a successful futures trader who didnt know anythin …
Psychology and Money Management
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
What broker to use for trading palladium futures
Commodities
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #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
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 683 since Jun 2009
Thanks Given: 758
Thanks Received: 787


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


© 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