multiple tick chart indicator

Questions about MultiCharts and user contributed studies.
acdrew0
Posts: 1
Joined: 28 Apr 2015

multiple tick chart indicator

Postby acdrew0 » 28 Apr 2015

I’m trying to make an indicator that draws from information on 3 different tick chart levels, which I could then use for testing in market replay. I have been experimenting on how to do that in multicharts. Here is the code that I used:

Code: Select all

inputs: MALength( 4 );

variables: MA4( 0 ), MA42( 0 ), MA43( 0 );

MA4 = AverageFC( Close, MALength );
MA42 = AverageFC( Close, MALength ) of data2;
MA43 = AverageFC( Close, MALength ) of data3;

If

MA4 > MA4[1] AND
MA42 > MA42[1] AND
MA43 > MA43[1]

then

Plot1(1,"uptrend");
This was applied to a chart with three different timeframes and then set on market replay. The results were not what I expected. It seemed to partially work, triggering only sometimes.

I am curious if this type of code would be possible to do in multicharts. Or will I need to go about this a different way? Global variables, ADE, etc..?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: multiple tick chart indicator

Postby Henry MultiСharts » 01 May 2015

Code: Select all

MA42 = AverageFC( Close, MALength ) of data2;
MA43 = AverageFC( Close, MALength ) of data3;
Hello acdrew0,

Should it be calculated on respective data series the following way?

Code: Select all

MA42 = AverageFC( Close of data2, MALength ) of data2;
MA43 = AverageFC( Close of data3, MALength ) of data3;

Code: Select all

then Plot1(1,"uptrend");
Should the plot reset to zero if the conditions are not met?

Code: Select all

then Plot1(1,"uptrend") else plot1(0);


Return to “MultiCharts”