//tick中的历史申卖申卖价如何取,判断主动买,主动卖;
Params
//此处添加参数
//Numeric millsecs(1000);
Vars
Series<Numeric> baramount;
Series<Numeric> barvol;
Series<Numeric> dayavg;
Numeric CON1(0);
Numeric CON2(0);
//String symbol;
//Bool GetTick(String symbol, TickRef tick);
tick my_tick;
Events
OnBar(ArrayRef<Integer> indexs)
{
if( TrueDate(0) !=TrueDate(1))
{
baramount=close*Vol;
barvol=vol;
}else
{
baramount = baramount[1]+close*vol;
barvol = barvol[1]+vol;
}
dayavg = baramount / barvol;
Plotnumeric("dayavg",dayavg);
//If ( TrueDate(0) !=TrueDate(1))
// Plotnumeric("dayavg",dayavg,0,Black);
FileAppend("C:\\FormulaTICIK.log","TICK = "+Text(Close));
Commentary("TICK=" +TEXT(Open)+","+TEXT(High)+","+TEXT(LOW)+","+TEXT(Close) + ","+TEXT(Vol)+ ","+TEXT(OpenInt));
GetTick(symbol,my_tick);
Commentary("AskPrice="+text(my_tick.bidask1.askP)); //申卖价 1
// Commentary("AskVol="+text(tickData.bidask1.askV)); //申卖量 1
Commentary("BidPrice="+text(my_tick.bidask1.bidP)); //申买价 1
// Commentary("BidVol="+text(tickData.bidask1.bidV)); //申买量 1CurrentBar()
Commentary("CurrentBar()="+text(CurrentBar())); //
//Commentary("CurrentBar()="+text(GetTick(my_tick,1))); //申卖价 1
}