程序化和量化交易...吧 关注:110贴子:69
  • 0回复贴,共1

RB,SR交易系统源码

只看楼主收藏回复

Params
Numeric EntryStop(0.5);
Numeric stop(0.5);
Numeric malen(60);
Vars
Numeric ma;
Begin
ma = Average(open,malen);
if(CurrentBar > malen)
{
if(MarketPosition == 0)
{
if(Open >= ma)
{
if(high/open >= 1+EntryStop/100)
{
Buy(1,open*(1+EntryStop/100));
Return;
}
}
Else
{
if(low/open <= 1-EntryStop/100)
{
SellShort(1,open*(1-EntryStop/100));
Return;
}
}
}
if(MarketPosition == 1)
{
if(low/open <= 1-stop/100)
{
sell(1,open*(1-stop/100));
Return;
}
}
if(MarketPosition == -1)
{
if(High/open >= 1+stop/100)
{
BuyToCover(1,open*(1+stop/100));
Return;
}
}
}
End


IP属地:云南1楼2017-01-19 09:09回复