Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
offset +1 #477375
06/20/19 13:04
06/20/19 13:04
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Hi,

how to call any FCE every 6-th minute?

Code
void run(){
  LookBack = 0;

  BarPeriod = 1;
  FrameOffset = 1;
  TimeFrame = 5;  
  if (frame(0))
    printf("\nframe%d   %s:%f",i,datetime(),second());

}



this no work

Re: offset +1 [Re: Grat] #477376
06/20/19 13:22
06/20/19 13:22
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
I have a small problem with FrameOffset
Code
string datetime()
  {
    return strf("%04d-%02d-%02d %02d:%02d",
      year(),month(),day(),hour(),minute());
  }
//--
void run(){
  LookBack = 0;
  set(STEPWISE|LOGFILE);

  BarPeriod = 1;
  FrameOffset = -1;
  TimeFrame = 5;  
  if (frame(0))
    printf("\nframe%d   %s:%f",i,datetime(),second());

}


with FrameOffset = -1;
Quote

[1: Thu 14-01-02 05:00] (1.37452)
Error 047: No bars to plot!
[2: Thu 14-01-02 05:01] (1.37448)
[3: Thu 14-01-02 05:02] (1.37472)
[4: Thu 14-01-02 05:03] (1.37461)
frame0 2014-01-02 05:03:0.000559 << offset -2
[5: Thu 14-01-02 05:04] (1.37468)
[6: Thu 14-01-02 05:05] (1.37476)
[7: Thu 14-01-02 05:06] (1.37475)
[8: Thu 14-01-02 05:07] (1.37470)
[9: Thu 14-01-02 05:08] (1.37468)
frame0 2014-01-02 05:08:0.000558 << offset -2
[10: Thu 14-01-02 05:09] (1.37472)
[11: Thu 14-01-02 05:10] (1.37474)
[12: Thu 14-01-02 05:11] (1.37472)
[13: Thu 14-01-02 05:13] (1.37473)
[14: Thu 14-01-02 05:14] (1.37472)
frame0 2014-01-02 05:14:0.000558 << offset -1
[15: Thu 14-01-02 05:15] (1.37474)
[16: Thu 14-01-02 05:16] (1.37472)
[17: Thu 14-01-02 05:17] (1.37473)
[18: Thu 14-01-02 05:18] (1.37472)
[19: Thu 14-01-02 05:19] (1.37473)
frame0 2014-01-02 05:19:0.000559 << offset -1
[20: Thu 14-01-02 05:21] (1.37472)
[21: Thu 14-01-02 05:22] (1.37472)
[22: Thu 14-01-02 05:23] (1.37477)
[23: Thu 14-01-02 05:24] (1.37479)
[24: Thu 14-01-02 05:25] (1.37478)
frame0 2014-01-02 05:25:0.000559 << offset 0 !!!
[25: Thu 14-01-02 05:26] (1.37478)
[26: Thu 14-01-02 05:27] (1.37476)
[27: Thu 14-01-02 05:28] (1.37478)


with FrameOffset=1
Quote

[4: Thu 14-01-02 05:03] (1.37461)
[5: Thu 14-01-02 05:04] (1.37468)
[6: Thu 14-01-02 05:05] (1.37476)
frame0 2014-01-02 05:05:0.000558 << offset 0
[7: Thu 14-01-02 05:06] (1.37475)
[8: Thu 14-01-02 05:07] (1.37470)
[9: Thu 14-01-02 05:08] (1.37468)
[10: Thu 14-01-02 05:09] (1.37472)
[11: Thu 14-01-02 05:10] (1.37474)
frame0 2014-01-02 05:10:0.000559 << offset 0
[12: Thu 14-01-02 05:11] (1.37472)
[13: Thu 14-01-02 05:13] (1.37473)
[11: Thu 14-01-02 05:10] (1.37474)
frame0 2014-01-02 05:10:0.000559 << offset 0
[12: Thu 14-01-02 05:11] (1.37472)
[13: Thu 14-01-02 05:13] (1.37473)
[14: Thu 14-01-02 05:14] (1.37472)
[15: Thu 14-01-02 05:15] (1.37474)
[16: Thu 14-01-02 05:16] (1.37472)
frame0 2014-01-02 05:16:0.000559 << offset 1 !!!
[17: Thu 14-01-02 05:17] (1.37473)
[18: Thu 14-01-02 05:18] (1.37472)
[19: Thu 14-01-02 05:19] (1.37473)



my question is, howto call FCE every 6-th minute?

note:
I trying find the system solution, not like this
Code
int n=minute();
if (n == 6 || n == 12 || n == 18 ....

Last edited by Grat; 06/20/19 13:24.
Re: offset +1 [Re: Grat] #477382
06/21/19 06:22
06/21/19 06:22
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Your timeframe selects every 5th bar, not evry 6th minute.

For every 6th minute, i would use if(minute() % 6 == 0).


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1