neonobblu: Please, advise me. I have connected to the signal and therefore I copy its open orders, can I change the volume of lot which it trades. How do I change the order volume?
I work with arrays - I need to write the tick arrival time in the array - for example, I write a bid. On every tick. I do everything according to tickets, for which I am grateful to Artyom Trishkin. Not everything works. Fought for the second day. Prints
Artyom Trishkin: I see that in init the variable SIZE has a value of 0, so what is the size of the array then? Then again in start SIZE is also 0 ... What's in the log?
//+------------------------------------------------------------------+//| Expert tick function |//+------------------------------------------------------------------+voidOnTick()
{
//---//--- Запись ID графика
gv_chart_id_name=Prefix+"_chart_id"; // имя GV терминалаlong chart_id=get.GetChartID(symbol); // id текущего графикаdouble chart_id_double=ToDouble(chart_id); // id в представлении doubleif(chart_id>=0) { // chart_id==0 в тестереif(!GlobalVariableCheck(gv_chart_id_name)) // Если GV-переменная удаленаGlobalVariableSet(gv_chart_id_name,chart_id_double); // создадим опять
}
else graph.Message("Чё-та нету chart_id : Symbol()="+symbol+", chart_id="+IntegerToString(chart_id));
//--- работа с тиками текущего графикаif(SymbolInfoTick(symbol,struct_tick)) {
double tick_bid=struct_tick.bid;
datetime tick_time=struct_tick.time;
WorkOnTick(symbol,tick_bid,tick_time,slowPeriod);
}
//---
}
//+------------------------------------------------------------------+
The function below organizes work with the desired symbol stored in the symbol variable, if you need to work with another symbol - write it there. Function FillArrays() just fills arrays.
//+------------------------------------------------------------------+void WorkOnTick(string sy, double symbol_bid, datetime symbol_time, int limit) {
long chart_id=get.GetChartID(sy);
int index_symbol=get.PositionsSymbolInList(sy); // позиция символа в спискеdouble pt=SymbolInfoDouble(sy,SYMBOL_POINT);
double pa=SymbolInfoDouble(sy,SYMBOL_ASK);
double pb=SymbolInfoDouble(sy,SYMBOL_BID);
int stoplevel=(int)MarketInfo(sy,MODE_STOPLEVEL);
int dg=(int)SymbolInfoInteger(sy,SYMBOL_DIGITS);
//--- заполним массивы
FillArrays(sy,symbol_bid,symbol_time,table_price,table_time);
//--- расчёт среднего изменения цен тиковdouble avg_change_price=AverageChangePrice(index_symbol,limit,slowPeriod,table_price);
//--- вывод информации на график
wtf(index_symbol,avg_change_price,slowPeriod,table_price,table_time);
return;
Trailing(sy, 50, 3, magic);
}
//+------------------------------------------------------------------+
I needed to fill the arrays with ticks this way:
//+------------------------------------------------------------------+void FillArrays(string sy, double price, datetime time, double &mass_price[][], datetime &mass_time[][]) {
//--- сместим данные в массивах влевоint index_symbol=get.PositionsSymbolInList(sy); // позиция символа в спискеfor(int i=99; i>0; i--) { // сместим данные в массивах влево
mass_price[index_symbol][i]=mass_price[index_symbol][i-1];
mass_time[index_symbol][i]=mass_time[index_symbol][i-1];
}
//--- запишем товый тик в массивы
mass_price[index_symbol][0]=price;
mass_time[index_symbol][0]=time;
}
//+------------------------------------------------------------------+
I don't get it - the SIZE is zero, so why change the size of the array first and then increase the SIZE? What a mess...
I once did an array filling with ticks for a ticking advisor, which determines the intensity and spread of ticks. I've cut out pieces for examples:
The function below organizes work with the desired symbol stored in the symbol variable, if you need to work with another symbol - write it there. Function FillArrays() just fills arrays.
I needed to fill the arrays with ticks this way:
I need an average rate of 1 tick/in 1 sec in n - ticks. I.e. n-ticks are received in k-seconds, k/n are received in ticks per second. This speed must be measured on each tick arriving. It will change with each subsequent tick.
Please, advise me. I have connected to the signal and therefore I copy its open orders, can I change the volume of lot which it trades. How do I change the order volume?
In the Provider's account all trades are executed with a volume of 0.1 lot. I want to have these trades copied to me with a larger volume, e.g. 0.3 lots. Can I increase volume manually?
Can I create rules to copy Provider's trades to Subscriber's one?
Look, on the four, I can't seem to get through...
I work with arrays - I need to write the tick arrival time in the array - for example, I write a bid. On every tick. I do everything according to tickets, for which I am grateful to Artyom Trishkin . Not everything works. Fought for the second day. Prints
zeros.
https://www.mql5.com/ru/forum/145455/page913#1017464
Thank you.
I see that in init the variable SIZE has a value of 0, so what is the size of the array then? Then again in start SIZE is also 0 ... What's in the log?
And so are zeros... I don't understand anything...
In the Provider's account all trades are executed with a volume of 0.1 lot. I want to have these trades copied to me with a larger volume, e.g. 0.3 lots. Can I increase volume by myself?
Can I create my own rules to copy trades from Provider's symbol to Subscriber's symbol?
And so are zeros... I don't understand anything...
Well, I hinted at the fact that SIZE must first be increased to make it non-zero, and only then change the size of the array.
:-)
Thanks.
It works - use it if you need it.
:-)
Spc.
It works - use it if you need it.
Something I don't understand - SIZE is zero, so why should I change the array size first, and then increase SIZE? What a mess...
I once did an array filling with ticks for a ticks Expert Advisor, which defines the intensity and range of ticks. I've cut out pieces for examples:
The function below organizes work with the desired symbol stored in the symbol variable, if you need to work with another symbol - write it there. Function FillArrays() just fills arrays.
I needed to fill the arrays with ticks this way:
I don't get it - the SIZE is zero, so why change the size of the array first and then increase the SIZE? What a mess...
I once did an array filling with ticks for a ticking advisor, which determines the intensity and spread of ticks. I've cut out pieces for examples:
The function below organizes work with the desired symbol stored in the symbol variable, if you need to work with another symbol - write it there. Function FillArrays() just fills arrays.
I needed to fill the arrays with ticks this way:
I need an average rate of 1 tick/in 1 sec in n - ticks. I.e. n-ticks are received in k-seconds, k/n are received in ticks per second. This speed must be measured on each tick arriving. It will change with each subsequent tick.
Can you tell me if there is a clock in mt4? Preferably with a second hand.
or maybe there is an Expert Advisor that would display the time somewhere in the bottom line of the terminal