1 registered members (AndrewAMD),
1,306
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Feature Request: Tick Volume
[Re: boatman]
#448173
01/22/15 17:33
01/22/15 17:33
|
Joined: Apr 2013
Posts: 57
3DCat
Junior Member
|
Junior Member
Joined: Apr 2013
Posts: 57
|
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.
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();
}
|
|
|
Re: Feature Request: Tick Volume
[Re: 3DCat]
#454654
09/13/15 11:00
09/13/15 11:00
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
User
|
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
Sorry for reopening this thread, but my question concerns exactly to this. Yes, the ticks in a bar are available and can be treated like price data. and from the manual: 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
|
|
|
Re: Feature Request: Tick Volume
[Re: jcl]
#454863
09/26/15 11:45
09/26/15 11:45
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
User
|
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
Many thanks! For the first I keep in mind that it is possible. 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?
|
|
|
|