上图中 绿色横向箭头:买入 红色横向箭头:卖出 黄色横向箭头:平仓 图中只有第一次交易是正确的,后面的交易没有在应该开仓的地方开仓 唉~~~ 交易思想很简单: 价格上穿“高黄线”做多,下穿“低黄线”做空,多头头寸在下穿“低红线”平仓,空头头寸在上穿“低红线”平仓。 希望达到的效果: 如果前一次交易是盈利的, 下一次信号发出时观望不做,等下下次信号发出才入场交易。如果前一次交易是亏损的,那么下一次信号有效。 图中第二次交易,不应该执行开空,而应该在绿色向下箭头处开多,在橙色向上箭头处平仓;橙色向上箭头右边是下一次信号,因为之前的交易是盈利的,所以不交易,在蓝色向下箭头处才开空头,然后在紫色叉叉处平仓,因为盈利,所以之后的向下突破不交易,然后在紫色向下箭头处做空。 请教各位老师~ 怎样写才能避免每一次信号都发单呢?(我有点笨,请高手们指点) 各位老师指导下吧~ 我的邮件: zhasam2028@163.com
我说的是F3能看到的全局变量哦 GlobalVariableCheck GlobalVariableDel GlobalVariableGet GlobalVariableName GlobalVariableSet GlobalVariableSetOnCondition GlobalVariablesDeleteAll GlobalVariablesTotal A group of functions intended for working with global variables. Global variables of the client terminal should not be mixed up with variables declared in the global scope of the MQL4 program. Global variables are kept in the client terminal within 4 weeks since the last access, then they will be deleted automatically. An access to a global variable is not only setting of a new value, but reading of the global variable value, as well. Global variables of the client terminal are accessible simultaneously from all MQL4 programs launched in the client terminal. 实在不行就用个csv文件来存储,可以了吧
for(int y=OrdersTotal();y>0;y--) { if(OrderSelect(y,SELECT_BY_POS,MODE_HISTORY)==false) break; if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) { if(OrderType==OP_BUY) } }