MA into array - MultiCharts | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > MultiCharts

MA into array
Started:December 15th, 2013 (06:26 AM) by no erocla Views / Replies:540 / 1
Last Reply:December 19th, 2013 (02:06 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

MA into array

Old December 15th, 2013, 06:26 AM   #1 (permalink)
Trading for Fun
turin italy
Futures Experience: Advanced
Platform: metatrader multichart
Favorite Futures: futures
Posts: 95 since May 2013
Thanks: 43 given, 4 received

MA into array

Hi all, i need help to develop e simple indicator in power language.

I would like to build a For Cycle that return the lowest value between many moving average, i build something like it:

var: min(0);

value88 1 To 20  begin

val[value88] = Average(c,value4 );
if (

It should plot just the lowest value between Average(c,5) , average(c,10), average(c,15) etc... but it doesnt work and cycle continue without an end.

Some help about ? thank you very much anyway !


No Erocla

Reply With Quote

Old December 19th, 2013, 02:06 PM   #2 (permalink)
Hamburg Germany
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
Posts: 1,109 since Apr 2013
Thanks: 188 given, 625 received

no erocla,

you could save a lot of time in your programming (especially when you have to debug code) if you'd use proper
variable names and comments. This makes code much easier to read and is a huge help in case you share code with others (post it on forums for example) or come back to a code after a couple of years.
The code below would do what you requested, but doesn't use an array:

	ii			(0),
	CurrentMA		(0),
	MALength		(0),
	LowestMAValue		(0);
//reset the values before the loop	
LowestMAValue = 999999;
MALength = 0;

//loop through 20 MAs and find the lowest one	
for ii = 1 to 20
	MALength = MALength + 5;
	CurrentMA = Average(Close, MALength);
	if CurrentMA < LowestMAValue then
		LowestMAValue = CurrentMA;

Plot1(LowestMAValue, "LowestMAValue");


Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > MultiCharts > MA into array

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
XAverage array in EasyLanguage Big Mike EasyLanguage Programming 13 December 16th, 2015 08:17 AM
Architecture / Public Array / Instantiate vantojo NinjaTrader Programming 8 November 3rd, 2013 06:06 PM
Filling an array with all trades done onava EasyLanguage Programming 5 April 27th, 2012 05:10 AM
Double MA and Triple MA Script Sadboybh NinjaTrader Programming 8 June 17th, 2011 08:57 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 03:53 PM.

Copyright © 2016 by 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 2016-10-28 in 0.07 seconds with 19 queries on phoenix via your IP