Problem with Multiple TimeFrame Updates of SLOWER timebase

Questions about MultiCharts and user contributed studies.
User avatar
ym
Posts: 53
Joined: 26 Feb 2010

Problem with Multiple TimeFrame Updates of SLOWER timebase

Postby ym » 10 Mar 2010

I am currently writing a strat that uses two timeframes :
- one is the 1mn, called data1
- the second is 5mn, called data2

IOG is (of course) 'ON'

I want, ON EACH TICK of data1 (1mn), to evaluate the value of data2 (5mn) and hence take the right decision from there ("opening" or not).

My problem is that data2 (5mn) updates each tick ONLY for one minute every five minutes and then does NOT update anymore during the next four minutes !!!

The data2 opens's and closes's update well at, say, 0740 thru last tick of 0740-bar, then no update during 0741-0742-0743 and 0744 bars ... then updating again at 0745 until the last tick of the 0745 bar ... and then again and again !

For example, if I use the following code :

Code: Select all

if currentbar=1 then cleardebug;
if lastbaronchart then
print (date:6:0, "-", time:4:0," - open/close data1(1mn): " , open data1:7:5,"/",close data1:7:5,
" - open/close data2(5mn): " , open data2:7:5,"/",close data2:7:5);
Log's results :
data2 updating correctly on each tick of data1 at 18H45
1100310-1845 - open/close data1(1mn): 1.36360/1.36360 - open/close data2(5mn): 1.36340/1.36360
1100310-1845 - open/close data1(1mn): 1.36360/1.36358 - open/close data2(5mn): 1.36340/1.36358
1100310-1845 - open/close data1(1mn): 1.36360/1.36358 - open/close data2(5mn): 1.36340/1.36358
1100310-1845 - open/close data1(1mn): 1.36360/1.36357 - open/close data2(5mn): 1.36340/1.36357
1100310-1845 - open/close data1(1mn): 1.36360/1.36357 - open/close data2(5mn): 1.36340/1.36357

data2 NOT updating correctly on each tick of data1 at 18H46, or 18H48
1100310-1846 - open/close data1(1mn): 1.36355/1.36353 - open/close data2(5mn): 1.36340/1.36354
1100310-1846 - open/close data1(1mn): 1.36355/1.36352 - open/close data2(5mn): 1.36340/1.36354
...
1100310-1849 - open/close data1(1mn): 1.36397/1.36397 - open/close data2(5mn): 1.36340/1.36354
1100310-1849 - open/close data1(1mn): 1.36397/1.36397 - open/close data2(5mn): 1.36340/1.36354
1100310-1849 - open/close data1(1mn): 1.36397/1.36399 - open/close data2(5mn): 1.36340/1.36354

What's wrong ?

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

Postby TJ » 10 Mar 2010

try the keyword LAST

User avatar
ym
Posts: 53
Joined: 26 Feb 2010

Postby ym » 10 Mar 2010

TJ,

Thx for your answer.

Here's an example of one of the (numerous) conditions that I use to "open" or not a LIMIT order IN my data1(1mn)-strat if certain conditions prevail on data2(5mn) :

Code: Select all

condition_PBS_UT5= ((close of data2) > (XAverage(close, EMA_Fast_UT5) of data2)) and ((open of data2) > (XAverage(close, EMA_Fast_UT5) of data2));
Then, where should I use this 'LAST' keyword ?

Thanks.
ym

User avatar
ym
Posts: 53
Joined: 26 Feb 2010

Postby ym » 11 Mar 2010

Here's a pic that clearly shows an instance where data (here Xaverage of 5-min data2) is not updated correctly during 4 minutes out of 5 !!!!

Whereas 1-min data1 updates just right ... only the slower timeframe (5-min data2) is concerned by this problem

What would be a practical solution to this issue ?

Thanks for your help.

Yann
Attachments
tmp.png
(49.9 KiB) Downloaded 262 times
tmp.zip
(48.84 KiB) Downloaded 116 times


Return to “MultiCharts”