multi frameindicator

Posted By: sergentGarcia

multi frameindicator - 03/10/18 12:16

Hello
I'm trying to use different timeframe with ichimoku.
I'd like have ichimoku in timeframe daily in 1 minutes trading
this is my script

Code:
void run()
{
	set(LOGFILE|PLOTNOW);
	set(TICKS);

	BarPeriod = 60;
	TimeFrame = 24;

	 vars H = series(priceHigh()), 
    L = series(priceLow()),
    O = series(priceOpen()),
    C = series(priceClose());
	 var Kijun = (MaxVal(H,26)+MinVal(L,26))/2;
	
	BarPeriod = 1;
	TimeFrame = 1;
	
	NumYears = 1;
	StartDate = 20180201;
	
	PlotScale = 8;
	PlotWidth = 1200;
	PlotHeight1 = 800;
	PlotHeight2 = 600;
	PlotDate = 20180201; 
	PlotBars = 2000;

	
	Ichimoku();
	plot("Kijun",Kijun,MAIN|LINE,BLUE);	
}



I chekeck with fxcm chart and kijun value is not good.
if i remove the two lines
Code:
BarPeriod = 1;
	TimeFrame = 1;


thekijun value is the same as fxcm charts.
Thank you
Posted By: MatPed

Re: multi frameindicator - 03/10/18 17:59

Ciao, Only one Barperiod allowed, but you can set several timeframe.
Try setting BarPeriod =1 and than set TimeFrame to 60 adjusting the code accordingly.

HtH
Posted By: sergentGarcia

Re: multi frameindicator - 03/10/18 18:28

thank you for your answer
i 've modified my script but the kijun value isn't the same as in fxcm charts.
I'd like to have the kijun daily in a 1 miniute trading.
So i've tried change timeframe to 1440(ie one day) and display it in a 1 muinute charte
what did i do wrong ?


Quote:


void run()
{
set(LOGFILE|PLOTNOW);
set(TICKS);


BarPeriod = 1;
TimeFrame = 1440;
frameSync(24);
vars H = series(priceHigh()),
L = series(priceLow()),
O = series(priceOpen()),
C = series(priceClose());
var Kijun = (MaxVal(H,26)+MinVal(L,26))/2;

TimeFrame = 1;
NumYears = 1;
StartDate = 20180201;

PlotScale = 8;
PlotWidth = 1200;
PlotHeight1 = 800;
PlotHeight2 = 600;
PlotDate = 20180201;
PlotBars = 2000;


Ichimoku();
plot("Kijun",Kijun,MAIN|LINE,BLUE);
}




Posted By: BobbyT

Re: multi frameindicator - 03/24/18 16:25

I could be wrong on this but try replacing:
Code:
TimeFrame = 1440;
frameSync(24);

with just:
Code:
TimeFrame = frameSync(1440);



I think as your code as is, is syncing the D1 to change frame every 24 days. This is because you have already set TimeFrame to D1.

Also, this is more flexible when setting timeframes as it is always relative to BarPeriod:
Code:
TimeFrame = x/BarPeriod

where x is whatever timeframe you want to use in minutes.

Cheers
© 2024 lite-C Forums