saving values from a multi-dimensional array - MultiCharts | futures io social day trading
futures io futures trading

saving values from a multi-dimensional array
Updated: Views / Replies:446 / 3
Created: by infe2015 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

saving values from a multi-dimensional array

  #1 (permalink)
Trading Apprentice
stockholm Sweden
Futures Experience: Intermediate
Platform: multichart
Favorite Futures: omxs30
Posts: 5 since Mar 2016
Thanks: 2 given, 1 received

saving values from a multi-dimensional array

Hi i need too saving some values in a multi-dimensional array
i have done it i a singel array like this
Upp1 = CUpp[1];
Upp2 = CUpp[2];
Upp3 = CUpp[3];
Upp4 = CUpp[4];
Upp5 = CUpp[5];
CuppSum = Summationarray(CUpp,5);
but i cant find the solution for multi-dimensional.
Thanks Infe

Reply With Quote
  #2 (permalink)
Market Wizard
Hamburg Germany
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
Posts: 1,731 since Apr 2013
Thanks: 265 given, 998 received
Forum Reputation: Legendary


what exactly seems to be the problem?

When storing values in a multidimensional array the only difference is that you have to specify all dimensions.

For your summation you will likely have to build your own function/code that cycles through all the array elements that you want to sum using a for loop.



Reply With Quote
  #3 (permalink)
Trading Apprentice
Salt Lake City, UT
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Emini ES
Posts: 11 since Jun 2017
Thanks: 0 given, 1 received

You can certainly achieve this using a recursive method.


Here is some C# code where I create an array with the following elements:
Element 0: Value 1
Element 1: Array with values 2 and 3
Element 2: Value 4
Element 3: Array with 2 elements:
Element 0: Array with two values: 5 and 6
Element 1: Value 7

The sum should be 28.

static void Main(string[] args)
object[] o = new object[4];
int value1 = 1;
object[] array1 = new object[2] {2, 3};
int value2 = 4;

object[] array_2_element_0 = new object[]{5,6};
object[] array2 = new object[2]{array_2_element_0, 7};

o[0] = value1;
o[1] = array1;
o[2] = value2;
o[3] = array2;

int sum = Sum(o);

private static int Sum(object obj)
int result = 0;

if (obj is object[])
object[] arr = (object[]) obj;
foreach (object o in arr)
result += Sum(o);
if (obj is int)
result = (int) obj;

return result;

Last edited by zaruski; August 17th, 2017 at 01:01 PM.
Reply With Quote
  #4 (permalink)
Trading Apprentice
Salt Lake City, UT
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Emini ES
Posts: 11 since Jun 2017
Thanks: 0 given, 1 received

Also, it just occurred to me, that you might be asking how to access array elements beyond the first dimension. It is done like this:

int x = array[0][0];

However, if you don't know how many dimensions you will have, then you must iterate through every element, rather than access elements by index.

Reply With Quote


futures io > > > > saving values from a multi-dimensional array

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

July Journal Challenge - $500 in Amazon Gift Cards!


Battlestations: $750 in prizes - Show us your trading desk!


TBA: FuturesTrader71 w/Morad Askar

Elite only

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to initialization two-dimensional array huzisg TradeStation 1 October 31st, 2016 11:26 PM
How to initialization two-dimensional array huzisg MultiCharts 1 October 21st, 2016 05:18 AM
Multi Time Frame - Index was outside the bounds of the array Jayswiss NinjaTrader Programming 5 July 3rd, 2016 03:48 PM
Dynamic BI-Dimensional Array no erocla MultiCharts 1 February 12th, 2016 10:22 AM
Two dimensional array in EasyLanguage Big Mike EasyLanguage Programming 6 August 17th, 2010 06:23 PM

All times are GMT -4. The time now is 04:09 AM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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.
no new posts
Page generated 2018-07-21 in 0.09 seconds with 22 queries on phoenix