if (rt[0].close>=iHigh(_Symbol,0,H))
{
if
(m_position.Select(_Symbol))
m_trade.PositionClose(_Symbol);
else //if(OrdersTotal()==0)
m_trade.PositionOpen(_Symbol,
ORDER_TYPE_BUY,Lots,SYMBOL_BID,0,0,"Buy");
}
Error:'if'-Semicolon expexted
What do you have before the first 'if'?
Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
I wrote this
Scroll up your Errors tab, what else do you see before "Error:'if'-Semicolon expexted"?
Scroll up your Errors tab, what else do you see before "Error:'if'-Semicolon expexted"?
if (rt[0].close>=iHigh(_Symbol,0,H)) { if (m_position.Select(_Symbol)) { m_trade.PositionClose(_Symbol); } else { m_trade.PositionOpen(_Symbol,ORDER_TYPE_BUY,Lots,SYMBOL_BID,0,0,"Buy"); } }
*it's no a shame to use { }* if you don't feel comfortable with indentation
*it's no a shame to use { }* if you don't feel comfortable with indentation
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
if (rt[0].close>=iHigh(_Symbol,0,H))
{
if (m_position.Select(_Symbol))
m_trade.PositionClose(_Symbol);
else //if(OrdersTotal()==0)
m_trade.PositionOpen(_Symbol,ORDER_TYPE_BUY,Lots,SYMBOL_BID,0,0,"Buy");
}
Error:'if'-Semicolon expexted