[警告关闭!]任何新手问题,为了不给论坛添乱。专业人士,不要走过。没有你,哪里都不能去。 - 页 892

 

嗨!我不知道????,这有什么问题?不修改市场订单
slb =NormalizeDouble(Bid - (StopLoss * Point),Digits); //计算买入头寸的止损//
tpb =NormalizeDouble(Ask + (TakeProfit* Point),Digits); //计算买入头寸的利润//
sls =NormalizeDouble(Ask + (StopLoss * Point),Digits)//计算卖出头寸的止损//
tps =NormalizeDouble(Bid - (TakeProfit* Point),Digits);

//================================================== ==================//
int total=OrdersTotal();
int n=0;
for (int i=total-1; i>=0; i-)
{
if(OrderSelect(i, SELECT_BY_POS)
{
if(OrderSymbol()==Symbol())
{
n++;
}}}
if ( total == 1 )
{
for (int k=total-1; k>=0; k--)
{
if( OrderSelect(k, SELECT_BY_TICKET)
Alert("order is", k);
{
if ((OrderType()==OP_BUY)&&(OrderTakeProfit()==0)&&(O rderStopLoss()==0)
{
OrderModify(k,OrderOpenPrice(),slb,tpb,0,Blue);
Alert("error",GetLastError());

}}}}
return(0); }

问题是什么,请帮助...........?????

 

任何新来者的问题,为了不使论坛变得杂乱无章。不要让专业人士与你擦肩而过。没有你,它无处可去。

 
belck:

任何新手问题,为了不给论坛添乱。不要让专业人士与你擦肩而过。没有你,它无处可去。

你的观点是什么?这有点像允许你询问时间...或健康...:))))))
 


对不起,我不明白问题出在哪里。 我想我从来没有满足过while条件,因为如果我把Comment放在循环里面,它就没有反映出来。 另外,在循环上面,我把变量B等于正常的预期值,例如0.0011,但如果我把它乘以Point,结果是0!!!!

int start()

{
double A,B,C ;A=Close[1];B=Close[Bars];
C=A-B ;Comment("Value of differencei " , B*Point);
while (B*Point >Swing)
{ Comment("Value of Difference", B);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-stoploss*Point,Ask+TakeProfit*Point,"macd sample",16384,0,Green);}

while (0-B*Point<Point)
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+stoploss*Point, Bid-TakeProfit*Point,"macd sample",16384,0,Red);

Alert("Value " , B);

Comment("Value differencei " , B);

//

//----
return(0);
}

 

我不确定,但正确的方法应该是

int start()

{
double A,B,C ;A=Close[1];B=Close[bar]; Close[bar]是什么意思; ????关闭[条形数字序列向后,不含当前]。

以前的蜡烛收盘[1].以前的蜡烛收盘[2]

B=(A-B)*Point ; Comment("Value of difference", B); B将等于前一根蜡烛的收盘价减去你在B= close中设置的蜡烛的收盘价 [....]
while(B > B) and most likely not while a if the condition
{ Comment("Value Difference", B);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-stoploss*Point,Ask+TakeProfit*Point,, "macd sample",16384,0,Green) 。

}

while(0-V<Round) and most likely not while a if condition

{

OrderSend(Symbol(,OP_SELL,Lots,Bid,3,Ask+stoploss*Point,Bid-TakeProfit*Point, "macd sample",16384,0,Red);
}
Alert("Value " ,B);

Comment("Value differencei " ,B);

//----

//----
return(0);
}
可能是错误的.....

 
谢谢你!!!。 我会试一试的。 三天来,我搞不清楚哪里出了问题,技术上来说,一切似乎都是对的。
 
不,这是同样的事情。 谢谢你的回答。我不知道问题出在哪里。
 

你的代码中有很多错误......,你想做什么结果呢?应该没有俄罗斯字母...

你不能在电子表格中出现C,因为C在内存中有一个数字,如1.23456

0-B将是一个负数....

 

并且最好按以下方式计算损益

slb =NormalizeDouble(Bid - (StopLoss * Point),Digits); // 计算买入头寸的止损//
tpb =NormalizeDouble(Ask + (TakeProfit* Point),Digits); // 计算买入头寸的利润//
sls =NormalizeDouble(Ask + (StopLoss * Point),Digits)//
tps =NormalizeDouble(Bid - (TakeProfit* Point),Digits); //计算卖出头寸的利润//。

 
Dimka-novitsek:


对不起,我不明白问题出在哪里。 我想我从来没有满足过while条件,因为如果我把Comment放在循环里面,它就没有反映出来。 另外,在循环上面,我把变量B等于正常的预期值,例如0.0011,但如果我把它乘以Point,结果是0!!!!

int start()

{
double A,B,C ;A=Close[1];B=Close[Bars];
C=A-B ;Comment("Value of differencei " , B*Point);
while (B*Point >Spread)
{ Comment("Value of Difference", B);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-stoploss*Point,Ask+TakeProfit*Point,"macd sample",16384,0,Green);}

while (0-B*Point<Point)
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+stoploss*Point, Bid-TakeProfit*Point,"macd sample",16384,0,Red);

Alert("Value " , B);

Comment("Value differencei " , B);

//

//----
return(0);
}

而你在招摇撞骗,你需要把A和B之间的差异乘以点?

A和B的值是实数。通过将它们的差值乘以点,你进一步增加了小数点的位数。如果你需要得到一个整数来与一个 "Spread "整数进行比较,你更应该用Point进行除法。