請問;當根K棒的成交量与10日均量比值第二次大於2.3時則卖出;要怎么寫程式
var: ma_volume(0), count(0);
ma_volume=averagefc(ticks,10);
if ma_volume<>0 then
condition1=ticks/ma_volume>2.3;
if condition1 then
count=count+1;
if count=2 then
sellshort next bar at market;
注意事项:
1. ma_volume表示10日均量,condition1表示当根bar的成交量与10日均量比值大于2.3的条件
2. 变量count用于统计condition1第几次成立
3. 当count为2时执行卖空的操作(若是卖出平仓,则使用sell语句)