Posted By: gtell
Short period ALMA - 10/23/17 17:53
Dear JCL,
Dear all,
I am working with some export of variables.
Consider the following example:
it gives me the following output:
The following R code works fine:
apart the first 3/4 N/A.
In Zorro the lower period number accetped is 6.
No chance adjusting sigma and offset parameters.
Do you know what is the reason?
Thanks.
Cheers
Dear all,
I am working with some export of variables.
Consider the following example:
Code:
function run() { StartDate = 20160101; EndDate = 20160531; LookBack = 150; vars Open = series(priceOpen()); vars Close = series(priceClose()); vars Low = series(priceLow()); vars High = series(priceHigh()); vars A3 = series(ALMA(Close,3)); vars M3 = series(SMA(Close,3)); string Format = ifelse(assetType(Asset) == FOREX, "n%04i-%02i-%02i %02i:%02i, %.5f, %.5f, %.5f, %.5f, %.5f, %.5f", "n%04i-%02i-%02i %02i:%02i, %.1f, %.1f, %.1f, %.1f, %.1f, %.1f"); char FileName[40]; sprintf(FileName,"History\%sTestExport.csv",strx(Asset,"/","")); // remove slash from forex pairs if(is(INITRUN)) file_write(FileName,"Date,Open,High,Low,Close,ALMA3,MA3",0); else file_append(FileName,strf(Format, year(0),month(0),day(0),hour(0),minute(0), round(Open[0],0.1*PIP), round(High[0],0.1*PIP), round(Low[0],0.1*PIP), round(Close[0],0.1*PIP), A3[0], M3[0])); }
it gives me the following output:
Code:
Date,Open,High,Low,Close,ALMA3,MA3 2015-12-22 11:00, 1.09364, 1.09377, 1.09294, 1.09312, 1.#QNAN, 1.09312 2015-12-22 12:00, 1.09312, 1.09467, 1.09263, 1.09413, 1.#QNAN, 1.09346 2015-12-22 13:00, 1.09413, 1.09479, 1.09344, 1.09410, 1.#QNAN, 1.09378 2015-12-22 14:00, 1.09410, 1.09611, 1.09407, 1.09564, 1.#QNAN, 1.09462 2015-12-22 15:00, 1.09564, 1.09705, 1.09486, 1.09684, 1.#QNAN, 1.09553 2015-12-22 16:00, 1.09684, 1.09844, 1.09633, 1.09654, 1.#QNAN, 1.09634 2015-12-22 17:00, 1.09654, 1.09793, 1.09627, 1.09776, 1.#QNAN, 1.09705 2015-12-22 18:00, 1.09776, 1.09822, 1.09638, 1.09708, 1.#QNAN, 1.09713 2015-12-22 19:00, 1.09708, 1.09709, 1.09637, 1.09677, 1.#QNAN, 1.09720 2015-12-22 20:00, 1.09677, 1.09699, 1.09468, 1.09515, 1.#QNAN, 1.09633 2015-12-22 21:00, 1.09515, 1.09574, 1.09505, 1.09511, 1.#QNAN, 1.09568 2015-12-22 22:00, 1.09511, 1.09583, 1.09505, 1.09569, 1.#QNAN, 1.09532 2015-12-22 23:00, 1.09569, 1.09576, 1.09499, 1.09512, 1.#QNAN, 1.09531 2015-12-23 00:00, 1.09512, 1.09534, 1.09461, 1.09490, 1.#QNAN, 1.09524 2015-12-23 01:00, 1.09490, 1.09530, 1.09488, 1.09506, 1.#QNAN, 1.09503 2015-12-23 02:00, 1.09506, 1.09530, 1.09413, 1.09429, 1.#QNAN, 1.09475 2015-12-23 03:00, 1.09429, 1.09443, 1.09332, 1.09421, 1.#QNAN, 1.09452 2015-12-23 04:00, 1.09421, 1.09482, 1.09381, 1.09471, 1.#QNAN, 1.09440 2015-12-23 05:00, 1.09471, 1.09474, 1.09361, 1.09381, 1.#QNAN, 1.09424 2015-12-23 06:00, 1.09381, 1.09423, 1.09380, 1.09413, 1.#QNAN, 1.09422 2015-12-23 07:00, 1.09413, 1.09425, 1.09348, 1.09383, 1.#QNAN, 1.09392 2015-12-23 08:00, 1.09383, 1.09427, 1.09293, 1.09355, 1.#QNAN, 1.09384 2015-12-23 09:00, 1.09355, 1.09356, 1.09149, 1.09203, 1.#QNAN, 1.09314 2015-12-23 10:00, 1.09203, 1.09335, 1.09169, 1.09216, 1.#QNAN, 1.09258 2015-12-23 11:00, 1.09216, 1.09337, 1.09213, 1.09216, 1.#QNAN, 1.09212 2015-12-23 12:00, 1.09216, 1.09349, 1.09214, 1.09305, 1.#QNAN, 1.09246 2015-12-23 13:00, 1.09305, 1.09316, 1.09191, 1.09225, 1.#QNAN, 1.09249 2015-12-23 14:00, 1.09225, 1.09228, 1.08996, 1.09012, 1.#QNAN, 1.09181 2015-12-23 15:00, 1.09012, 1.09136, 1.08937, 1.09104, 1.#QNAN, 1.09114 2015-12-23 16:00, 1.09104, 1.09111, 1.08769, 1.08769, 1.#QNAN, 1.08962 2015-12-23 17:00, 1.08769, 1.08943, 1.08728, 1.08746, 1.#QNAN, 1.08873 2015-12-23 18:00, 1.08746, 1.08825, 1.08700, 1.08813, 1.#QNAN, 1.08776 2015-12-23 19:00, 1.08813, 1.09090, 1.08799, 1.09063, 1.#QNAN, 1.08874 2015-12-23 20:00, 1.09063, 1.09182, 1.09026, 1.09115, 1.#QNAN, 1.08997 2015-12-23 21:00, 1.09115, 1.09245, 1.09064, 1.09191, 1.#QNAN, 1.09123 2015-12-23 22:00, 1.09191, 1.09192, 1.09084, 1.09143, 1.#QNAN, 1.09150 2015-12-23 23:00, 1.09143, 1.09215, 1.09046, 1.09056, 1.#QNAN, 1.09130 2015-12-24 00:00, 1.09056, 1.09109, 1.09053, 1.09085, 1.#QNAN, 1.09095 2015-12-24 01:00, 1.09085, 1.09192, 1.09085, 1.09159, 1.#QNAN, 1.09100 2015-12-24 02:00, 1.09159, 1.09217, 1.09125, 1.09167, 1.#QNAN, 1.09137 2015-12-24 03:00, 1.09167, 1.09348, 1.09166, 1.09344, 1.#QNAN, 1.09223
The following R code works fine:
Code:
alma<-ALMA(price[ ,4],2)
apart the first 3/4 N/A.
In Zorro the lower period number accetped is 6.
No chance adjusting sigma and offset parameters.
Do you know what is the reason?
Thanks.
Cheers