Feature Request: Tick Volume

Posted By: boatman

Feature Request: Tick Volume - 01/13/15 04:27

I know that there is no common exchange for forex, and therefore no accurate volume data, but I have been reading about using tick volume as a proxy for actual volume and the idea seems to have some merit.

Would it be possible to incorporate a feature in Zorro that can handle tick volume data and use it as an input for a system?

I don't know how much of an effort this would be, since volume data is different to the OHLC structure of Zorro's price data. Perhaps a work around would be to sum the ticks in a bar and then set the opening volume equal to the lowest volume and the closing volume equal to the highest volume for each bar. That way Zorro could handle tick volume in the same way it handles price data. Is that even possible?

Cheers
Kris
Posted By: jcl

Re: Feature Request: Tick Volume - 01/19/15 16:41

Yes, the ticks in a bar are available and can be treated like price data. It is planned to implement data streams for ticks and other data in one of the next versions.
Posted By: 3DCat

Re: Feature Request: Tick Volume - 01/20/15 17:03

I guess tick volume means "number of ticks per bar"?
Posted By: boatman

Re: Feature Request: Tick Volume - 01/21/15 22:21

jcl, that's great news! I am very excited about experimenting with tick data and support its inclusion as a high priority.

3DCat - that's correct.
Posted By: 3DCat

Re: Feature Request: Tick Volume - 01/22/15 17:33

ok. thats kinda raw and full of unnecessary things, but i implemented it once, used some code from the manual and a counter, not more:
you can ignore the logic- least to say is it isn't profitable like that:) but the tc series represents tick volume per minute in that case.

Code:
int count=1;
int lastcount=1;
int b=0;

int tmfTick()
{
	if(b==Bar) count++; else {lastcount=count;count=1;b=Bar;}
        return 0;
}

// start a pending phantom trade for activating a TMF
bool initTick() 
{
  static TRADE* tick = 0;
  if(tick || Bar < LookBack) 
    return false;
  Lots = -1;              // phantom trade
  Entry = 2*priceClose(); // high entry limit
  EntryTime = 999999;     // keep pending forever
  tick = enterLong(tmfTick);
  Lots = 1;               // back to default values
  Entry = 0.;
  EntryTime = 1;
  return tick != 0;
}

function run()
{
	set(TICKS+PLOTNOW);
	Weekend=1;
  BarPeriod=1;
  StartDate=20141202;
  EndDate=20141209;
  PlotWidth=1024;
  Hedge=5;
  LookBack=201;
	Lots=100;
  vars Price=series(price());
  var Dom=DominantPeriod(Price,100);
  vars BP=series(BandPass(Price,Dom*2,0.1));
  plot("BP",BP[0],NEW,BLACK);
  vars tc=series(count);
  vars SM=series(SMA(tc,200));
  var w=(MaxVal(tc,200)-MinVal(tc,200))/3;
  //if (is(INITRUN)) 
  initTick();
  
 // plot("tickCount",lastcount,NEW,BLACK);
  plot("count",count,NEW,BLUE);
  plot("sm",SM[0],0,BLACK);
  plot("upper",SM[0]+w,0,CYAN);
  plot("lower",SM[0]-w,0,MAGENTA);
  plot("Bar",Bar,NEW,BLACK);
  Stop=3*ATR(60);
  Trail=2*ATR(60);
  TrailSlope=350;
 // TrailLock=80;
  if (crossOver(tc,SM[0]-w)and falling(BP) and NumOpenLong<1 //and Bar>360
  ) enterLong();
  if (crossOver(tc,SM[0]-w) and rising(BP) and NumOpenShort<1 //and Bar>360
  ) enterShort();
  
}

Posted By: Sphin

Re: Feature Request: Tick Volume - 09/13/15 11:00

Sorry for reopening this thread, but my question concerns exactly to this.

Quote:
Yes, the ticks in a bar are available and can be treated like price data.

and from the manual:

Quote:
The fOpen, fClose, fHigh and fLow data streams can be separately accessed in the script. They can alternatively be used to store and access additional data, such as spread, quote frequency, trade volume, [...]

It sounds as if it would be possible, but how can I access the tick volume in a script practically? I think in the normal history (.bar) files it is not set, so do I have to create 'extended .bar files' with a column for the tick volume first (it is generally available through FXCM's ForexConnect API if I understood its manual right)? Or is manually counting the ticks like in 3DCat's example the only way?

Thanks, Sphin
Posted By: jcl

Re: Feature Request: Tick Volume - 09/21/15 09:42

I have not tried it, but this should work: Define a pseudo asset like "EURUSD_VOL", and import a price curve of that asset in .bar format. The tick volume can then be either the High, Low, Open, or Close of that curve and you can read it with the price functions.

Alternatively you can also import .t1 format. It contains only a single data value instead of 4 and thus uses less memory. Read it with priceClose().
Posted By: Sphin

Re: Feature Request: Tick Volume - 09/26/15 11:45

Many thanks! For the first I keep in mind that it is possible. laugh I read the manual about creating a pseudo asset but I do not understand how to download/access other than price information, in this case the tick volume.
Using t1 means to count the ticks that belong to one minute or to the corresponding bar period?
Posted By: Sphin

Re: Feature Request: Tick Volume - 09/30/15 21:55

Using t1 (and also in live trading) it's easy to account it with the tick() function that I recognized just now, but this works well.
© 2024 lite-C Forums