问题描述
我一直在为 MetaTrader 4 编写专家顾问课程,但我的代码不断出现错误,但我没有看到错误。
代码的目标是知道点是什么,并根据入场价格和固定点值计算止盈和止损
TestResult.Outcome
程序第 51 行意外结束
//+------------------------------------------------------------------+
//| CalculateStoplossAndTakeProfit.mqh |
//| Jiano van Goethem |
//| |
//+------------------------------------------------------------------+
#property copyright "Jiano van Goethem"
#property link ""
#property strict
#include <Pipcalculator.mqh>
void OnStart()
{
//---
Alert("");
double SignalPrice = 1.368;
int TakeProfitPips = 50;
int Stoplosspips = 50;
double GetPipValue = GetPip
if(Ask < SignalPrice) // buying
{
Alert("sending buy order ");
double StopLossprice = Ask - Stoplosspips * GetPipValue();
double TakeProfitPrice = Ask + TakeProfitPips * GetPipValue();
Alert("entry price = " + Ask);
Alert ("Stop loss price = " + StopLossprice);
Alert ("Take profit price = " + TakeProfitPrice);
//send buyorder
}
else if(Bid > SignalPrice) // selling
{
Alert("sending sell order ");
double StopLossprice = Bid + Stoplosspips * GetPipValue();
double TakeProfitPrice = Bid - TakeProfitPips * GetPipValue();
Alert("entry price = " + Bid);
Alert ("Stop loss price = " + StopLossprice);
Alert ("Take profit price = " + int(TakeProfitPrice));
//send sellorder
}
}
不平衡括号行 11
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)