Ti stai perdendo delle opportunità di trading:
- App di trading gratuite
- Oltre 8.000 segnali per il copy trading
- Notizie economiche per esplorare i mercati finanziari
Registrazione
Accedi
Accetti la politica del sito e le condizioni d’uso
Se non hai un account, registrati
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol()) continue;
//---Check Order Type
if(OrderType()==OP_BUY)
{
if(fastma < slowma)
{
if(OrderClose(OrderTicket(),Lots,OrderClosePrice(),10,clrNONE))
Print("Order Closed : ", OrderClosePrice());
else
Print("Error Closing order ", GetLastError());
}
}
if(OrderType()==OP_SELL)
{
if(fastma > slowma)
{
if(OrderClose(OrderTicket(),Lots,OrderClosePrice(),10,clrNONE))
Print("Order Closed : ", OrderClosePrice());
else
Print("Error Closing Order : ", GetLastError());
}
}
}
Sleep(300000);
return(0);
}
Sì - devi fare il conto alla rovescia quando chiudi gli ordini:
Sì - devi fare il conto alla rovescia quando chiudi gli ordini:
Perché dovresti continuare?
Perché continuare?
//|System start |
//+---------------------------------------------+
int start()
{
double fastma, slowma;
int ticket, total;
//---define Ma's
fastma = iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,0);
slowma = iMA(NULL,0,8,0,MODE_SMA,PRICE_CLOSE,0);
total = OrdersTotal();
//---Start operations
if(total < 1)
{
if(fastma > slowma)
{
ticket = OrderSend(Symbol(),OP_BUY,Lots,Ask,10,0,0,"",0,0,Blue);
if(ticket > 0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
Print("Buy order opened : ", OrderOpenPrice());
}
else
Print("Error opening order : ", GetLastError());
return(0);
}
if(fastma < slowma)
{
ticket = OrderSend(Symbol(),OP_SELL,Lots,Bid,10,0,0,"",0,0,Red);
if(ticket > 0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
Print("Sell order opened : ", OrderOpenPrice());
}
else
Print("Error opening order : ", GetLastError());
return(0);
}
return(0);
}
for(int i=OrdersTotal()-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderMagicNumber()!=MagicNumber && OrderSymbol()!=Symbol()) continue;
//---Check Order Type
if(OrderType()==OP_BUY)
{
if(fastma < slowma)
{
if(OrderClose(OrderTicket(),Lots,OrderClosePrice(),10,clrNONE))
Print("Order Closed : ", OrderClosePrice());
else
Print("Error Closing order ", GetLastError());
}
}
if(OrderType()==OP_SELL)
{
if(fastma > slowma)
{
if(OrderClose(OrderTicket(),Lots,OrderClosePrice(),10,clrNONE))
Print("Order Closed : ", OrderClosePrice());
else
Print("Error Closing Order : ", GetLastError());
}
}
}
Sleep(300000);
return(0);
}
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderMagicNumber()!=MagicNumber || OrderSymbol()!=Symbol()) continue;
//---Check Order Type
if(OrderType()==OP_BUY)
OrderSelect(i,SELECT_BY_POS)
&& OrderMagicNumber() == MagicNumber
&& OrderSymbol() == Symbol()
){
//---Check Order Type
if(OrderType()==OP_BUY)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderMagicNumber()!=MagicNumber && OrderSymbol()!=Symbol()) continue;
//---Check Order Type
if(OrderType()==OP_BUY)
OrderSelect(i,SELECT_BY_POS)
&& OrderMagicNumber() == MagicNumber
&& OrderSymbol() == Symbol()
){
//---Check Order Type
if(OrderType()==OP_BUY)
Ogni grafico non funziona ancora in modo indipendente, c'è qualcos'altro che posso fare?
E nel modo in cui è codificato, non chiude più i trade.
total = OrdersTotal();
//---Start operations
if(total <= 1)