Simple Mean Reversion 621 replies
Pairs Trading: Reversion to the Mean 22 replies
Forward test of my new mean reversion strategy 11 replies
Question for synthetic and non-synthetic currency pairs 0 replies
Cointegration, Synthetic hedges, mean reversion in R, Tech Thread 0 replies
DislikedHello,
So the Hedge is multicollinearity or not ? spurious regressions or not ?Ignored
Dislikedthank you very much 7bit for sharing your knowledge , may you explain about diff and intercept in settingIgnored
DislikedI'm not going to answer this question yet another time.
Go back to the beginning of the thread and start reading it in its entirity. I'm not going to explain the same things repeatedly every week again and again and again. Its all archived in the thread for exactly this purpose. Also you should read the source code, there you will see much clearer than I could ever explain what exactly it does.
Also there is not much new "knowledge" coming from me, I only did the boring and time consuming job of coding some existing concepts in mql4.Ignored
double hist[]; int i; double c; double time[]; int R; double pred[]; double buf[]; int init(){ SetIndexBuffer(0, buf); SetIndexStyle(0, DRAW_LINE); SetIndexShift(0, 0); R = RInit("C:/Program Files/R/R-2.12.1/bin/i386/RTerm.exe --no-save", 2); Comment("history: " + back + " bars, method: OLS, order: " + order); if (UninitializeReason() != REASON_CHARTCHANGE){ StartR(RPATH, RDEBUG); Rx("options(device='windows')"); } } int deinit(){ RDeinit(R); } int start(){ SetIndexDrawBegin(0,Bars-back); if (RIsBusy(R)){ return(0); } ArrayResize(hist, back); ArrayResize(time, back); ArrayResize(pred, back); for (i=0; i<back; i++){ hist[i] = Close[i]; time[i] = Time[i]; } if (RGetInteger(R, "as.integer(exists('model'))") == 1){ RExecute(R, "model <- lm(hist ~ time)"); RExecute(R, "stddev <- sd(resid(model))"); double stddev = RGetDouble(R,"stddev"); RGetVector(R, "rev(fitted(model))", pred, back); for (i=0; i<back; i++){ buf[i] = pred[i]; } } RAssignInteger(R, "back", back); RAssignVector(R, "hist", hist, ArraySize(hist)); RAssignVector(R, "time", time, ArraySize(time)); RExecute(R, "hist <- rev(hist)"); RExecute(R, "time <- rev(time)"); RAssignInteger(R,"model",1); return(0); }
DislikedI was under the impression that R was supposed to execute faster than mql4 code, but my indicator is pretty slowIgnored
DislikedI read your object pascal thread [...] but I was somewhat overwhelmed by the syntax.Ignored
Disliked
Originally Posted by vitali_yv
7bit, I`ve noticed you are using USDJPY in your calculations - it has different point value. How do you consider it?
Its documented in the code....Ignored
DislikedI tried to use other indices than forex pairs, and for some reason it appears to always give them 0 loading.Ignored
DislikedYou would have to modify the code that calculates these factors, the best way would be to use information returned by MarketInfo(). I don't have any indices on my platform, I have only forex, so I did not include any code to deal with it.Ignored
DislikedBrian,
The "BasketFile" blank input is a kind of "set file" you can set, which shall contain the basket description.
It is a replacement for the "BasketPairs" inputs.
You can "save" your baskets into various basket files and load them easily that way....Ignored