【发布时间】:2021-02-16 16:36:07
【问题描述】:
我现在非常困惑,已经有一段时间了。我试图弄清楚为什么当我相信 if 语句为真时,这个字符串函数不会更新字符串。
void OnTick()
{
string aboveprofit = "";
for ( int b = OrdersTotal() - 1; b >= 0; b-- )
{
if ( OrderSelect( b, SELECT_BY_POS, MODE_TRADES ) )
if ( OrderSymbol() == Symbol() )
{
if ( OrderSymbol() == OP_SELL )
{
OrderModify( OrderTicket(),
OrderOpenPrice(),
Bid + ( 150 * _Point ),
OrderTakeProfit(),
0,
CLR_NONE
);
if ( Ask < OrderOpenPrice() )
{
abovepoint = "321";
}
}
if ( OrderSymbol() == OP_BUY )
{
OrderModify( OrderTicket(),
OrderOpenPrice(),
Ask - ( 150 * _Point ),
OrderTakeProfit(),
0,
CLR_NONE
);
if ( Bid > OrderOpenPrice() )
{
abovepoint = "123";
}
}
}
}
【问题讨论】:
标签: mql4 trading algorithmic-trading forex mt4