Gamestudio Links
Zorro Links
Newest Posts
Bmap creation - wrong Alpha values
by txesmi. 12/11/19 12:43
A9
by preacherX. 12/11/19 11:01
Error Message 010: invalid stops
by Volker. 12/11/19 08:25
AssetFix & Assets.csv
by MatPed. 12/11/19 07:03
How to handle profit in a TMF during training
by StefanCGN. 12/09/19 20:09
Simulate complex commission costs [Test]
by AndrewAMD. 12/09/19 13:52
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
6 registered members (Iglarion, timW, MatPed, Quad, 2 invisible), 659 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
PabloMF, deepscreener, wzschultz, Alit, cmor
18341 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Indicator and TimeFrame #470516
01/17/18 23:09
01/17/18 23:09
Joined: May 2015
Posts: 164
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 164
Czech Republic
Hi,

I have this simple script ( only for testing )
this problem is described in manual:
TimeFrame does not affect a few indicators that do not use a Data series, but directly the current asset price series. This is mentioned in the description of the indicator.

Code:
void run()
{
	assetList("AssetsCur.csv");
	set(LOGFILE|PLOTNOW);
	set(TICKS);

	NumYears = 1;
	StartDate = 20170101;
	
	PlotScale = 8;
	PlotWidth = 1200;
	PlotHeight1 = 450;
	PlotHeight2 = 120;
	PlotDate = 20170601; 
	PlotBars = 200;

	BarPeriod = 5;
	TimeFrame = 12;	
		
	var *Price = series(price());		
	vars Trend1 = series(LowPass(Price,80));
	plot ("Price",Price,MAIN|LINE,ORANGE);
	plot("LP",Trend1,MAIN|LINE,BLUE);
	
}



after run I get this screen:






















but after remove the
Code:
TimeFrame=12;

- run only with BarPeriod is the indicator smoothed.




After change BarPeriod=60; / 5*12 / I get also different values in the indicators:




Sumary:
BarPeriod*TimeFrame / TimeFrame > 1 / not get the same value from indicator




Attached Files
SnÝmek obrazovky 2018-01-17 vá17.14.22.png (802 downloads)
BarPeriod60
Last edited by Grat; 01/17/18 23:58.
Re: Indicator and TimeFrame [Re: Grat] #470519
01/18/18 11:23
01/18/18 11:23
Joined: Jul 2000
Posts: 27,070
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,070
Frankfurt
That's right. But what was the question?

Re: Indicator and TimeFrame [Re: jcl] #470522
01/18/18 13:14
01/18/18 13:14
Joined: May 2015
Posts: 164
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 164
Czech Republic
no question, only explain for the other people, how work TimeFrame.

Re: Indicator and TimeFrame [Re: Grat] #470532
01/18/18 17:33
01/18/18 17:33
Joined: May 2015
Posts: 164
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 164
Czech Republic
so, I have question:

how to get the same price in the exact time? For 2.1.2017 00:00:00 - price don't have same value

BarPeriod=60
TimeFrame=1
Date: 02.01.17 00:00:00 Price: 1.05265 Trend: 1.05179

BarPeriod=5
TimeFrame =12
Date: 02.01.17 00:00:00 Price: 1.05301 Trend: 1.05455

BarPeriod=5
TimeFrame =1
Date: 02.01.17 00:00:00 Price: 1.05261 Trend: 1.05348

BarPeriod=1
TimeFrame =1
Date: 02.01.17 00:00:00 Price: 1.05259 Trend: 1.05289

BarPeriod=1
TimeFrame =0
Date: 02.01.17 00:00:00 Price: 1.05290 Trend: 1.05290

Code:
printf("nDate: %s Price: %.5f Trend: %.5f",datetime(),Price[0],Trend1[0]);


Re: Indicator and TimeFrame [Re: Grat] #470537
01/19/18 07:48
01/19/18 07:48
Joined: Jul 2000
Posts: 27,070
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,070
Frankfurt
price() is the mean price of the bar, so it depends on bar length. priceClose() is the price at the exact time.

Re: Indicator and TimeFrame [Re: jcl] #471766
03/19/18 14:52
03/19/18 14:52
Joined: Nov 2017
Posts: 39
Germany
E
easyX Offline
Newbie
easyX  Offline
Newbie
E

Joined: Nov 2017
Posts: 39
Germany
How can i get the H1 CCI while using 1 or 5 min BarPeriod?

What is the "current asset price series" in case i have BarPeriod = 5 is it always using M5 data then?

Does a change of TimeFrame (12) give me my H1 data?

Re: Indicator and TimeFrame [Re: easyX] #471906
03/24/18 20:15
03/24/18 20:15
Joined: Jun 2017
Posts: 78
B
BobbyT Offline
Junior Member
BobbyT  Offline
Junior Member
B

Joined: Jun 2017
Posts: 78
Hi easyX,

I'm also trying to work through some timeframe/indicator related issues and have a current thread about it.

The way I understand BarpPeriod/TimeFrame and price/indicator data is this....

BarPeriod will generate the following price series for BarPeriod: priceOpen(), priceHigh(), priceLow() and priceClose()

So in your example, the above functions will be autofilled every pass of run() which technically you could say it is filled every 5 minutes.

If you call TimeFrame(12) then yes, you will be looking at H1 data. Any call to the above functions, while TimeFrame = 12, will give you H1 data for that feature.
Of course you can always set up a TimeFrame specific series with
Code:
vars C = series(priceClose());

to make accessing non current bar elements easier.

I may have this completely wrong given I'm having problems of my own with this kind of thing.

Cheers

Last edited by BobbyT; 03/24/18 20:16.
Re: Indicator and TimeFrame [Re: BobbyT] #471910
03/25/18 11:56
03/25/18 11:56
Joined: Apr 2008
Posts: 256
Austria
Petra Offline
Member
Petra  Offline
Member

Joined: Apr 2008
Posts: 256
Austria
Thats right, with 5 min barperiod, the TimeFrame of 1 hour is 60/5 = 12. And for catching the hour boundaries its TimeFrame = frameSync(12).

Re: Indicator and TimeFrame [Re: Grat] #478629
11/17/19 12:39
11/17/19 12:39
Joined: Nov 2018
Posts: 7
A
aventador Offline
Newbie
aventador  Offline
Newbie
A

Joined: Nov 2018
Posts: 7
I have question.

How to make weekly timeframe with BarPeriod = 60 ?

The reason to use Barperiod 60 is to trade market in timeframe 1 hour.

For example :-

If weekClose[0] > weekClose[1] then weeksignal = 1 else weeksignal = 0

in timeframe 1 hour if SMA10 > SMA30 and weeksignal = 1 then enterlong
else if SMA10 < SMA30 and weeksignal = 0 then entershort

Last edited by aventador; 11/17/19 12:48.
Re: Indicator and TimeFrame [Re: Grat] #478640
11/18/19 12:44
11/18/19 12:44
Joined: Jul 2000
Posts: 27,070
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,070
Frankfurt
For a weekly time frame from 1h bars, you can use the synchronization mechanism described under "TimeFrame". But for that week signal you need no extra time frame. Just store the close at the end of Friday and compare with the previous stored close.

Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1