Multiple Time Frames on one chart

Indicators coded by community members
Message
Author
djspinburner
Posts: 12
Joined: Mon Nov 09, 2015 9:35 pm

Multiple Time Frames on one chart

#1 Postby djspinburner » Mon Nov 09, 2015 10:01 pm

I wrote my indicators for FT2 and though they work, the one I need to read a higher time frame doesn't read it. Can someone assist?

djspinburner
Posts: 12
Joined: Mon Nov 09, 2015 9:35 pm

Re: Multiple Time Frames on one chart

#2 Postby djspinburner » Fri Nov 13, 2015 10:41 am

Here is the code, really trying to figure out how to make this read a higher time frame that is specified via TimeFrame Variable.
procedure Calculate(index: integer); stdcall;

var
c: Double;

begin
//SetCurrencyAndTimeframe(Symbol(), TimeFrame());
c := iClose(Symbol(), TimeFrame, 0);
FastSMA[TimeFrame] := GetMA(TimeFrame, 0, fastperiod, TMAType(MAtype), TPriceType(ApplyToPrice),
FastSMA[TimeFrame + 1]);
SlowSMA[TimeFrame] := GetMA(TimeFrame, 0, slowperiod, TMAType(MAtype), TPriceType(ApplyToPrice),
SlowSMA[TimeFrame + 1]);

FSSMA[TimeFrame] := FastSMA[TimeFrame] + VShift*Point;
SSSMA[TimeFrame] := SlowSMA[TimeFrame] + VShift*Point;

if ((FSSMA[TimeFrame] > SSSMA[TimeFrame]) and (c > FSSMA[TimeFrame])) or ((FSSMA[TimeFrame] < SSSMA[TimeFrame]) and (c > FSSMA[TimeFrame])) then
begin
buff1[index] := 0;
buff2[index] ;
buff3[index] ;
buff4[index] := 1;
end;
if ((FSSMA[TimeFrame] > SSSMA[TimeFrame]) and (c < SSSMA[TimeFrame])) or ((FSSMA[TimeFrame] < SSSMA[TimeFrame]) and (c < FSSMA[TimeFrame])) then
begin;
buff5[index] := 0;
buff6[index] ;
buff7[index] ;
buff8[index] := 1;
end;
if ((c > FSSMA[TimeFrame]) and (c< SSSMA[TimeFrame])) or ((c < FSSMA[TimeFrame]) and (c > SSSMA[TimeFrame])) then
begin
buff9[index] := 0;
buff10[index] ;
buff11[index] ;
buff12[index] := 1;
end;
end;

exports

Init, Calculate, OnParamsChange;

end.

Stonev
Posts: 204
Joined: Thu Jan 28, 2010 2:20 pm

Re: Multiple Time Frames on one chart

#3 Postby Stonev » Sun Nov 15, 2015 2:09 pm

Hi,
try this
but sorry if not works, i did not test.
MAtype should be "0" (SMA), other type will lye
telling true, FT2 MTF indicators are not from "simple code" list.
if you need something more difficult i can help for some fee.

Alexey


djspinburner wrote:
procedure Calculate(index: integer); stdcall;

var
c: Double;
TF:integer;

begin
TF:=Period_H1; // //higher TF
//SetCurrencyAndTimeframe(Symbol(), TimeFrame());
c := iClose(Symbol(), TF, index);
FastSMA[index] := GetMA(TF, index, fastperiod, TMAType(MAtype), TPriceType(ApplyToPrice), FastSMA[index+ 1]);
SlowSMA[index] := GetMA(TF, index,, slowperiod, TMAType(MAtype), TPriceType(ApplyToPrice), SlowSMA[index+ 1]);

FSSMA[index] := FastSMA[index] + VShift*Point;
SSSMA[index] := SlowSMA[index] + VShift*Point;

if ((FSSMA[index] > SSSMA[index]) and (c > FSSMA[index])) or ((FSSMA[index] < SSSMA[index]) and (c > FSSMA[index])) then
begin
buff1[index] := 0;
buff2[index] :=???;
buff3[index] :=???;
buff4[index] := 1;
end;
if ((FSSMA[index] > SSSMA[index]) and (c < SSSMA[index])) or ((FSSMA[index] < SSSMA[index]) and (c < FSSMA[index])) then
begin;
buff5[index] := 0;
buff6[index] :=???;
buff7[index] :=???;
buff8[index] := 1;
end;
if ((c > FSSMA[index]) and (c< SSSMA[index])) or ((c < FSSMA[index]) and (c > SSSMA[index])) then
begin
buff9[index] := 0;
buff10[index] :=???;
buff11[index] :=???;
buff12[index] := 1;
end;
end;

exports

Init, Calculate, OnParamsChange;

end.
Coding & Converting

djspinburner
Posts: 12
Joined: Mon Nov 09, 2015 9:35 pm

Re: Multiple Time Frames on one chart

#4 Postby djspinburner » Tue Nov 17, 2015 10:45 am

Didn't quite work, but getting close. How much you charge and I would need the source code as well

Stonev
Posts: 204
Joined: Thu Jan 28, 2010 2:20 pm

Re: Multiple Time Frames on one chart

#5 Postby Stonev » Tue Nov 17, 2015 2:03 pm

Hello
details in PM

Alexey
Coding & Converting


Return to “Indicators”

Who is online

Users browsing this forum: No registered users and 30 guests