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
6 registered members (EternallyCurious, AndrewAMD, ricky_k, 7th_zorro, 2 invisible), 478 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Counting Ticks per hour #481628
10/10/20 21:03
10/10/20 21:03
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
Figured seems not that easy to count upTicks vs. downTicks per Bar and reset counter on every new bar.

Surely, continuesly counting is somewhat easy....

function tick()
{
shift(closeTick, priceClose(), 2); // shift the series

if(closeTick[0] > closeTick[1]){
upTick += 1;
return upTick;
}

if(closeTick[0] < closeTick[1]){
downTick += 1;
return downTick;
}
}


Somebody has an idea to approach that?

Re: Counting Ticks per hour [Re: danatrader] #481636
10/11/20 12:08
10/11/20 12:08
Joined: Oct 2017
Posts: 56
Munich
K
kalmar Offline
Junior Member
kalmar  Offline
Junior Member
K

Joined: Oct 2017
Posts: 56
Munich
I'm not sure if it will be useful for you, but marketVol() for FXCM delivers Tick frequency: https://www.zorro-trader.com/manual/en/fxcm.htm

Re: Counting Ticks per hour [Re: danatrader] #481641
10/11/20 15:28
10/11/20 15:28
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
Also MT4 seems to deliver that, problem here, only in live, so I have no option to use it in backtesting or development.

Re: Counting Ticks per hour [Re: danatrader] #481643
10/12/20 06:28
10/12/20 06:28
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
i thinking ( from head )

Code

// global var


int tmpCount=0;
int lastHour=0;
int dnTick = upTick = 0;
var lastPrice;

void tick(){
   tmpCount++;     // increment every ticks
  if (lastPrice > priceClose())
    dnTick++;
  else
    upTick++;
...
}

void run(){
    BarPeriod=60;

   if(is(INITRUN)){
      tmpCount=0;
      lastHour=0;
   }

  if(!is(LOOKBACK)){
    // .... this code run every new H1 candle
    // in the dnTick & upTick is tick info from last hour
    ....
    ....
    // -- now reset for newcandle
    lastHour=tmpCount;
    tmpCount=0;
    upTick=0;
    dnTick=0;
    lastPrice=priceClose();
  }
}


in manual:
Quote
In a TMF or tick function, priceClose() returns the last price quote, updated every tick when new price data becomes available. price() returns the price averaged over all received ticks of the current bar so far; therefore it is more 'jaggy' at the begin of the bar when few ticks were received yet, and more smooth towards the end of the bar period. priceHigh() and priceLow() return the highest and lowest price of the current bar so far, so their distance is small at the begin of the bar and wide towards the end.

Last edited by Grat; 10/12/20 06:36.
Re: Counting Ticks per hour [Re: danatrader] #481644
10/12/20 07:52
10/12/20 07:52
Joined: Oct 2017
Posts: 56
Munich
K
kalmar Offline
Junior Member
kalmar  Offline
Junior Member
K

Joined: Oct 2017
Posts: 56
Munich

Re: Counting Ticks per hour [Re: danatrader] #481645
10/12/20 08:09
10/12/20 08:09
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
This python script make candles from ticks CSV file. But this is old way, now is better use the Pandas ( ohlc fce ).

I thinking first question not howto convert tick to candles but how many times tick go up/dn during H1 candle


Moderated by  Petra 

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