Indicator from daily bars from signal based on 1 minute bars

Questions about MultiCharts and user contributed studies.
maddog206
Posts: 3
Joined: 19 Oct 2016

Indicator from daily bars from signal based on 1 minute bars

Postby maddog206 » 20 Dec 2016

Hi, I have developed a signal based on one minute bars. Now I want to add an indicator (50 day moving average) to my signal base on daily close bars. I want to trade in the direction of the trend, indicated by the 50 day moving average. How do I code an indicator base on daily bars to my signal that is using one minute bars? Thanks.

User avatar
siscop
Posts: 197
Joined: 09 Jan 2011
Has thanked: 34 times
Been thanked: 29 times

Re: Indicator from daily bars from signal based on 1 minute bars

Postby siscop » 20 Dec 2016

Just write your own indicator using CloseD(x) as Close of the Day. The Plot2 is just for comparison so you see that it has the same data

Code: Select all

inputs:
MaLen(10);

variables:
MaIndi(0),
var0(0),
Ma2Indi(0);

///////Indi for M1
MaIndi=0;
for var0=1 to MaLen
begin
MaIndi=MaIndi+CloseD(var0);
end;
MaIndi=MaIndi/MaLen;

////////Indi for D1
Ma2Indi=Average(c,MaLen)data2;

Plot1(MaIndi,"MaM1");
Plot2(Ma2Indi,"MaD1");
M1D1Daten.png
(65.68 KiB) Downloaded 603 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Indicator from daily bars from signal based on 1 minute bars

Postby TJ » 20 Dec 2016

Hi, I have developed a signal based on one minute bars. Now I want to add an indicator (50 day moving average) to my signal base on daily close bars. I want to trade in the direction of the trend, indicated by the 50 day moving average. How do I code an indicator base on daily bars to my signal that is using one minute bars? Thanks.

See post #18
Multi-data strategy... pg. 43
viewtopic.php?f=16&t=10811

User avatar
siscop
Posts: 197
Joined: 09 Jan 2011
Has thanked: 34 times
Been thanked: 29 times

Re: Indicator from daily bars from signal based on 1 minute bars

Postby siscop » 20 Dec 2016

I dont think that multidata does apply here since he just wants to use one data stream and that is M1 so using CloseD(x) to rewrite the indicator is the best way to go.
On my example above the data2 stream was just to compare that the CloseD(x) Plot1 was working right.


Return to “MultiCharts”