Multiple Time Frames on one chart
-
- Posts: 12
- Joined: Mon Nov 09, 2015 9:35 pm
Multiple Time Frames on one chart
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?
-
- Posts: 12
- Joined: Mon Nov 09, 2015 9:35 pm
Re: Multiple Time Frames on one chart
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.
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.
-
- Posts: 204
- Joined: Thu Jan 28, 2010 2:20 pm
Re: Multiple Time Frames on one chart
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
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
-
- Posts: 12
- Joined: Mon Nov 09, 2015 9:35 pm
Re: Multiple Time Frames on one chart
Didn't quite work, but getting close. How much you charge and I would need the source code as well
-
- Posts: 204
- Joined: Thu Jan 28, 2010 2:20 pm
Who is online
Users browsing this forum: No registered users and 1 guest