Testing 'CopyTicks' - page 3

 

I'm not testing, I'm reminding the developers. Practice shows that it is never superfluous)).

As for deal direction - in Forts it is always given by the exchange.

The algorithm currently used in the terminal is not suitable for this - you have to take information from the exchange.

 
Dmitriy Skub:

I'm not testing, I'm reminding the developers. Practice shows that it is never superfluous)).

About deal direction - on forts it is always given by the exchange.

The algorithm which is now used in the terminal is not suitable for this - we must necessarily take information from the exchange.

There are just several topics about copyticks (and mqltickinfo) ending with "waiting".

Here is more, for example:

https://www.mql5.com/ru/forum/61607


So really, "waiting for". :-)

CopyTicks на медленном рынке
CopyTicks на медленном рынке
  • www.mql5.com
На нём видно, что после получения первых 10 тиков после запуска терминала, CopyTicks перестаёт работать:. - - Категория: автоматические торговые системы
 
What's the situation with CopyTicks() now in the 1210 build?
 
Михаил:
And now, in the 1210 build, how is CopyTicks() doing?
Everything is fine:Tick story
 
Михаил:
And now, in 1210 build, how is it with CopyTicks()?

Almost works. No duplicates. Volumes are not lost.

But, the direction of trades in flags is missing. Bid/ask calculation does not give proper fidelity.

The actual structure is old and differs from what is described in the help. So I understand that this is an intermediate build. So, as always, we are waiting for the next one))

 
Dmitriy Skub:

It almost works. No duplicates. Volumes are not missing.

But, the direction of trades in flags is missing. Bid/ask calculation does not give proper fidelity.

The real structure is old and different from the one described in the help. So I understand that this is an intermediate build. So, as always, we are waiting for the next one))

Thanks
 

Forum on trading, automated trading systems and testing trading strategies

MqlTick

zimbabve15, 2016.02.03 06:15

Broker "Opening" tool ED-3.16 left table - tick data is written by indicator in OnCalculate procedure via SymbolInfoTick request, right table - via CopyTicks. Structure of both: time, bid, ask, flipper, volume, time_msec, flag.

Why the same ticks have different volumes and flags?

If we receive raw data from the broker with zero flags through SymbolInfoTick, then it looks like the terminal processes the incoming tick and assigns a flag to it based on comparison with the previous tick? What to do with the volumes? The difference is significant.


Forum on trading, automated trading systems and strategy testing

MqlTick

zimbabve15, 2016.02.03 06:39

FiboFroup broker left ticks tablevia SymbolInfoTick , right table via CopyTicks. Structure of both: time, bid, ask, strike, volume, time_msec, flag.

Flags are different, because bid/ask values in the same ticks, written in different ways.


 
zimbabve15:


Is it an epidemic to post "sheets" without any code?
 

CopyTicks

//////////////////////////////////////////////////////////////////////////////////////////////////////////

MqlTick tick_array[];

int OnInit()
{
int copied=CopyTicks(_Symbol,tick_array,COPY_TICKS_ALL,0,countHistoryTicks);
if(Save_File!=NOT_SAVE)
{
SaveTicksToFile(tick_array);
}
return(INIT_SUCCEED);

}


void SaveTicksToFile(MqlTick &massiveTicks[])

{

string filename,file_buffer;

StringConcatenate(filename,Symbol(),".txt");

int file_handle=FileOpen(filename,FILE_READ|FILE_WRITE|FILE_ANSI|FILE_SHARE_READ);

FileSeek(file_handle,0,SEEK_END);

int sizeMassiveTicks=ArraySize(massiveTicks);

int i=0;

while(i<sizeMassiveTicks)

{

StringConcatenate(file_buffer,TimeToString(massiveTicks[i].time,TIME_DATE|TIME_SECONDS)," ",DoubleToString(massiveTicks[i].bid,_Digits)," ",DoubleToString(massiveTicks[i].ask,_Digits)," ",DoubleToString(massiveTicks[i].last,_Digits)," ",IntegerToString(massiveTicks[i].volume,_Digits)," ",IntegerToString(massiveTicks[i].time_msc)," ",IntegerToString(massiveTicks[i].flags,_Digits));

FileWrite(file_handle,file_buffer);

i++;

}

FileClose(file_handle);

}

SymbolInfoTick

////////////////////////////////////////////////////////////////////////

int OnCalculate(const int rates_total,

const int prev_calculated,

const datetime &time[],

const double &open[],

const double &high[],

const double &low[],

const double &close[],

const long &tick_volume[],

const long &volume[],

const int &spread[])

{

MqlTick last_tick;

SymbolInfoTick(Symbol(),last_tick);


TickStruct tick={0,0,0,0,0,0,0};

tick.time=TimeCurrent();

tick.bid=last_tick.bid;

tick.ask=last_tick.ask;

tick.flag=last_tick.flags;

tick.last=last_tick.last;

tick.time_msc=last_tick.time_msc;

tick.volume=last_tick.volume;

int total=ArraySize(g_ticks);

if(ArrayResize(g_ticks,total+1,1000)<0)

{

Alert(": the indicator does not have enough memory to save the next tick data;)

}

else

{

g_ticks[total]=tick;

UpTick[rates_total-1]=total;

}

if(total>999)

{

SaveTempTicks();

ArrayFree(g_ticks);

}

return(rates_total);

}

void SaveTempTicks()

{

// Creation of tick history file

int hTicksFile=FileOpen(Symbol()+"fullTicks.tks",FILE_BIN|FILE_READ|FILE_WRITE|FILE_SHARE_READ|FILE_SHARE_WRITE);

if(hTicksFile<1)

return;

FileSeek(hTicksFile,0,SEEK_END);

//Write file

int total=ArraySize(g_ticks),i=0;

while(i<total)

{

if(FileWriteStruct(hTicksFile,g_ticks[i])==0)

{

Print("Saving data to a temporary file failed...");

return;

}

i++;

}

FileClose(hTicksFile);

}

 
Please correct your post(Insert the code correctly in the forum). It would be good if you attach the file itself (*.mq5) in addition to the code in your message.