//+------------------------------------------------------------------+//| |//+------------------------------------------------------------------+enum ENUM_COPY_TICKS
{
TICKS_INFO=1, // only/Bid è Ask
TICKS_TRADE=2, // only/Last è Volume
TICKS_ALL=-1, // all ticks
};
//--- input parametersinputint ticks=1; // number of requested tics//--- parametersinput ENUM_COPY_TICKS type=COPY_TICKS_TRADE;
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- indicator buffers mappingPrint(TICK_FLAG_BID," - tick has changed a Bid price");
Print(TICK_FLAG_ASK," - a tick has changed an Ask price");
Print(TICK_FLAG_LAST," - a tick has changed the last deal price");
Print(TICK_FLAG_VOLUME," - a tick has changed a volume");
Print(TICK_FLAG_BUY," - a tick is a result of a buy deal");
Print(TICK_FLAG_SELL," - a tick is a result of a sell deal");
//---return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constint begin,
constdouble &price[])
{
//--- the array that receives ticksMqlTick tick_array[];
MqlTick t;
//--- requesting ticksint copied=CopyTicks(_Symbol,tick_array,type,0,ticks);
//--- if ticks are received, show the Bid and Ask values on the chart//--- generate the comment contents /*
string flags="";
if((tick_array[0].flags &TICK_FLAG_BID)==TICK_FLAG_BID)
flags=" TICK_FLAG_BID "+id;
if((tick_array[0].flags &TICK_FLAG_ASK)==TICK_FLAG_ASK)
flags+=" TICK_FLAG_ASK "+id;
if((tick_array[0].flags &TICK_FLAG_LAST)==TICK_FLAG_LAST)
flags+=" TICK_FLAG_LAST "+id;
if((tick_array[0].flags &TICK_FLAG_VOLUME)==TICK_FLAG_VOLUME)
flags+=" TICK_FLAG_VOLUME "+id;
if((tick_array[0].flags &TICK_FLAG_BUY)==TICK_FLAG_BUY)
flags+=" TICK_FLAG_BUY "+id;
if((tick_array[0].flags &TICK_FLAG_SELL)==TICK_FLAG_SELL)
flags+=" TICK_FLAG_SELL "+id;
*/if(copied>0){
Print(tick_array[0].volume);
}
//--- return value of prev_calculated for next callreturn(rates_total);
}
//+------------------------------------------------------------------+//| Indicator deinitialization function |//+------------------------------------------------------------------+voidOnDeinit(constint reason)
{
//--- Comment("");
}
//+------------------------------------------------------------------+
Olá,
Meu objetivo é exportar cada ordem executada no mercado, mas primeiro, preciso resolver este problema.
Não consigo plotar no console ou exportar sem que ocorra uma repetição das ordens executadas.
Alguém já passou por isso?
Para login e uso do site MQL5.com, você deve ativar o uso de cookies.
Ative esta opção no seu navegador, caso contrário você não poderá fazer login.
Você entrou na conta. A autenticação de dois fatores foi desativada. Configure-a novamente e escaneie um novo código QR ou continue com a autenticação de dois fatores desativada.