Machine learning in trading: theory, models, practice and algo-trading - page 473

 

For those who still participated in the numer.ai contest -

There once introduced their cryptocurrency (NMR), and at first gave it away a little bit to active contest participants, and then began to give for victories along with dollars, check may be you have accrued them. Now you can withdraw NMR from contest account, and through exchangers to the ordinary money.

Here is the exchange rate to the dollar, for examplehttps://www.cryptonator.com/rates/NMR-USD, quite a lot.
https://bittrex.com/Market/Index?MarketName=BTC-NMR

 
I think I've already asked here somewhere, but I forgot, how can I bring different currency pairs with different prices to a single scale that would allow you to add, subtract, etc. one BP from the other, and then there was the 101st brilliant idea and need 101st time to understand that it does not work)
 
mytarmailS:
I've already asked here somewhere, but I forgot, how can I bring different currency pairs with different prices to the same scale, that it would be possible to add, subtract, etc. one BP from the other, but I had the 101-th genius idea and for the 101-th time I realized that it does not work)

Variable normalization or normalization

 
mytarmailS:
I think I've already asked somewhere here, but I forgot, how can I bring different currency pairs with different prices to the same scale, that it would be possible to add, subtract, etc. one BP from the other, but I had the 101st genius idea and for the 101st time I realized that it does not work.)
multiple regression
 

Bros!!! Hi all.... I decided to migrate to MQL5, so please help me with code in some aspects... It takes too long to get an answer from support... They may not answer...

I made a new indicator but it does not output a value of a variable... Can someone tell me what to do?

Files:
ChekParam.mq5  11 kb
 

Help me remember how to do this ...

There are about 6 tools in a li sheet

head(li[[1]])
    ticker per     date   time  open  high   low close   vol
1 SPFB.RTS   5 20160104 100500 75390 76320 75250 76000 14319
2 SPFB.RTS   5 20160104 101000 76000 76030 75790 75900  4818
3 SPFB.RTS   5 20160104 101500 75920 76050 75850 75970  2947
4 SPFB.RTS   5 20160104 102000 75970 76120 75900 76080  2415
5 SPFB.RTS   5 20160104 102500 76080 76140 75870 75920  2347
6 SPFB.RTS   5 20160104 103000 75910 76010 75580 75640  3787
> head(li[[2]])
   ticker per     date   time  open  high   low close   vol
1 SPFB.BR   5 20160104 100500 36.67 38.20 36.67 37.63 40185
2 SPFB.BR   5 20160104 101000 37.63 37.64 37.58 37.61  5914
3 SPFB.BR   5 20160104 101500 37.62 37.63 37.56 37.61  5103
4 SPFB.BR   5 20160104 102000 37.62 37.77 37.62 37.73 13513
5 SPFB.BR   5 20160104 102500 37.74 37.78 37.59 37.60  5061
6 SPFB.BR   5 20160104 103000 37.60 37.66 37.48 37.53  6239
> head(li[[3]])
     ticker per     date   time  open  high   low close  vol
1 SPFB.GAZR   5 20160104 100500 13912 13943 13850 13936 4712
2 SPFB.GAZR   5 20160104 101000 13936 13943 13917 13937 1180
3 SPFB.GAZR   5 20160104 101500 13934 13937 13921 13926 1298
4 SPFB.GAZR   5 20160104 102000 13931 13938 13925 13934  294
5 SPFB.GAZR   5 20160104 102500 13935 13941 13927 13927  540
6 SPFB.GAZR   5 20160104 103000 13931 13934 13889 13896  704

All instruments have dates and time on different indexes, each instrument has "holes". How can I drop dates from all instruments and leave only those dates and time which are present in all instruments, simply speaking to synchronize all these dataframes

 
Mihail Marchukajtes:

Bros!!! Hi all.... I've decided to migrate to MQL5, so please help me with the code in some details... It takes too long to get an answer from support... They may not answer...

I made this code and it does not output variable value... Can someone tell me what to do?


1. You don't know which value you want to output.

2. The custom indicator is not called correctly. Read about the features of iCustom in MT5.

 
mytarmailS:

Help me remember how to do this ...

There are about 6 tools in a li sheet

How to remove from all tools the dates and times, that is to leave only the dates and times that are present in all tools, simply speaking to synchronize all these dataframes

I did so - created a new column where I combined date and time, and then searched for the coincidence of such values in different tables.
liSynchronized <- li
#создание  новой колонки по которой будут сравниваться значения разных таблиц
for(i in 1:length(liSynchronized)){
  liSynchronized[[i]]$datetime <- paste0(liSynchronized[[i]]$date, liSynchronized[[i]]$time)
}

while(TRUE){
  somethingChanged <- FALSE
  for(i in 1:length(liSynchronized)){
    syncIndexes <- rep(TRUE, nrow(liSynchronized[[i]]))
    for(j in (1:length(liSynchronized))[-i]){
      syncIndexes <- syncIndexes & (liSynchronized[[i]]$datetime %in% liSynchronized[[j]]$datetime)
    }
    if(!all(syncIndexes)){
      somethingChanged <- TRUE
    }
    liSynchronized[[i]] <- liSynchronized[[i]][syncIndexes, ]
  }
  if(!somethingChanged){
    break
  }
}

Also discarded bars introduce errors in ohlc values, i.e. the bar closed at one price, and then because of the deleted bar the next one in the table will open at a different price, and High and low of the deleted bar will be lost at all. High, low and close of the deleted bar should be compared with the previous non-removed bar and update it if necessary.
I was just working with open prices, so I did not bother so much.

 
Aleksey Vyazmikin:

1. It is not clear which value of the variable you want to output.

2. The custom indicator is not called correctly in the code - read about features of iCustom in MT5.


Ahem... ahem... How do you think this information helped me if I've already read the help and I'm a little bit confused....

 
Mihail Marchukajtes:

Ahem... Ahem... and how do you think this information helped me in any way???? if I already read the help and didn't understand a bit....


Well, how can you help if you haven't answered - what kind of variables do you need to call?

And for iCustom, you need to create a hendel - i.e. bind it to a variable.

I do it approximately like this in my Expert Advisor (the principle is the same in an indicator...)

//Хендали - мать их
int handle_iMomentum;

int OnInit()
  {
//Хендаль объявляем iMomentum
   handle_iMomentum=iMomentum(Symbol(),0,100,0);
   if(handle_iMomentum==INVALID_HANDLE)
     {
      PrintFormat("Failed to create handle of the iMomentum indicator for the symbol %s/%s, error code %d",
                  Symbol(),EnumToString(Period()),GetLastError());
      return(INIT_FAILED);
     }

   return(INIT_SUCCEEDED);
  }

void OnTick()
  {
double Momentum=Momentumf(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double Momentumf(const int index)
  {
   double MA[1];
   ResetLastError();
   if(CopyBuffer(handle_iMomentum,0,index,1,MA)<0)
     {
      PrintFormat("Failed to copy data from the iMA indicator, error code %d",GetLastError());
      return(0.0);
     }
   return(MA[0]);
  }