龙听期货论坛's Archiver

龙听 发表于 2018-3-25 17:33

文华赢智算法交易-操作符

[table=98%,#999999]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]+[/p][/td][td=1,1,72][p=30, 2, center]加法[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high+Price("m1109","New");//表示求m1109当前最高价及当前价格的和。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]-[/p][/td][td=1,1,72][p=30, 2, center]减法[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high-Price("m1109","New");//表示求m1109当前最高价及当前价格的差。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]*[/p][/td][td=1,1,72][p=30, 2, center]乘法[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high*Price("m1109","New");//表示求m1109当前最高价及当前价格的乘积。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]/[/p][/td][td=1,1,72][p=30, 2, center]除法[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high/Price("m1109","New");//表示求m1109当前最高价及当前价格的商。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]&&[/p][/td][td=1,1,72][p=30, 2, center]并且运算[/p][/td][td=1,1,381]
VAR high,low;
VOID MAIN()
{
high=High("m1109","High");//high的值为合约m1109当前最高价 low=Price("m1109","Low");//low的值为合约m1109当前最低价 high>Price("m1109","New")&&low<Price("m1109","New");//表示判断m1109当前最高价是否大于价格,并且,最低价小于当前价格。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]||[/p][/td][td=1,1,72][p=30, 2, center]或者运算[/p][/td][td=1,1,381]
VAR high,low;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
low=Price("m1109","Low");//low的值为合约m1109当前最低价
high>Price("m1109","New")||low<Price("m1109","New");//表示判断m1109当前最高价是否大于价格,或者,最低价小于当前价格。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]> [/p][/td][td=1,1,72][p=30, 2, center]大于运算[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high>Price("m1109","New");//表示判断m1109当前最高价是否大于当前价格。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]< [/p][/td][td=1,1,72][p=30, 2, center]小于运算[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high<Price("m1109","New");//表示判断m1109当前最高价是否小于当前价格。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]>=[/p][/td][td=1,1,72][p=30, 2, center]大于等于运算[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high>=Price("m1109","New");//表示判断m1109当前最高价是否大于等于当前价格。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]<=[/p][/td][td=1,1,72][p=30, 2, center]小于等于运算[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high<=Price("m1109","New");//表示判断m1109当前最高价是否小于等于当前价格。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]!=[/p][/td][td=1,1,72][p=30, 2, center]不等于运算[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high!=Price("m1109","New");//表示判断m1109当前最高价是否不等于当前价格。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]==[/p][/td][td=1,1,72][p=30, 2, center]等于运算[/p][/td][td=1,1,381]
VAR high;
VOID MAIN()
{
high=Price("m1109","High");//high的值为合约m1109当前最高价
high==Price("m1109","New");//表示判断m1109当前最高价是否等于当前价格。
}[/td][/tr]
[tr=#FFFFFF][td=1,1,39][p=30, 2, center]=[/p][/td][td=1,1,72][p=30, 2, center]为变量进行赋值[/p][/td][td=1,1,381]
VAR Price;
VOID MAIN()
{
Price=Price("m1109","New");//表示将合约m1109的当前价格赋值给Price变量。[/td][/tr]
[/table]

页: [1]