您需要 登录 才可以下载或查看,没有帐号?注册
div >
{
double MACD_1 = iMACD( Symbol(), 0, 200, 400, 9, PRICE_CLOSE, MODE_MAIN, 1 );
double MACD_2 = iMACD( Symbol(), 0, 200, 400, 9, PRICE_CLOSE, MODE_MAIN, 2 );//快线
double MACD_3 = iMACD( Symbol(), 0, 200, 400, 9, PRICE_CLOSE, MODE_SIGNAL, 1 );//慢线
double MACD_4 = iMACD( Symbol(), 0, 200, 400, 9, PRICE_CLOSE, MODE_SIGNAL, 2 );
int _GetLastError = 0, _OrdersTotal = OrdersTotal();
for ( int z = _OrdersTotal - 1; z z -- )
{
if ( !OrderSelect( z, SELECT_BY_POS ) )
{
_GetLastError = GetLastError();
Print( OrderSelect( , z, , SELECT_BY_POS ) - 错误# , _GetLastError );
continue;
}
if ( OrderSymbol() != Symbol() ) continue;
if ( OrderType() == OP_BUY )
{
if ( NormalizeDouble( MACD_1, Digits + 1 ) NormalizeDouble( MACD_3, Digits + 1 )
NormalizeDouble( MACD_2, Digits + 1 ) = NormalizeDouble( MACD_4, Digits + 1 ))
{
if ( !OrderClose( OrderTicket(), OrderLots(), Bid, 5, Green ) )
{
_GetLastError = GetLastError();
alert( 错误 OrderClose # , _GetLastError );
return(-1);
}
}
else return(0);
}
if ( OrderType() == OP_SELL )
{
if ( NormalizeDouble( MACD_1, Digits + 1 ) NormalizeDouble( MACD_3, Digits + 1 )
NormalizeDouble( MACD_2, Digits + 1 ) 1 ) 0.0
NormalizeDouble( MACD_2, Digits + 1 ) 0.0
NormalizeDouble( MACD_2, Digits + 1 ) 0.0
NormalizeDouble( MACD_3, Digits + 1 ) 0.0
NormalizeDouble( MACD_4, Digits + 1 ) 0.0
NormalizeDouble( MACD_1, Digits + 1 ) NormalizeDouble( MACD_3, Digits + 1 )
NormalizeDouble( MACD_2, Digits + 1 )
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!