[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Gravity center mustafa Belkhayate



PureBytes Links

Trading Reference Links

Thx Ed

I think I get your drift. Recalculate the poly per bar and populate an array(s) with the "would have been results" to be used in backtesting. If you look past the fancy math you will find this is just a mean reversion system so that likely turning points (extremes) can be found by other (simpler) means. I was just as skeptical as you but there are a number of these types of systems floating around that are supposedly highly profitable so I am having second thoughts. I suspect that MM techniques may have a lot to do with it.

Regards Conrad
    

--- In amibroker@xxxxxxxxxxxxxxx, "Edward Pottasch" <empottasch@xxx> wrote:
>
> I think you can't backtest unless you recalculate the polynomial for every bar. Maybe use 240 bars to calculate the polynomial, like a moving polynomial. But when plotting a moving polynomial the bands will not look that pretty, it will just look like a moving average. On one of these forums they mention that they made a version that does not repaint. I couldn't figure out from looking at the mq4 code what they did but I am pretty sure that it is just an ordinary polynomial fit. It is an ideal system to sell. It looks great and it can't be backtested. And if you use the polynomial as shown in the chart to do your backtest you will get great results but they are false results.
> 
> regards, Ed
> 
> 
> 
>   ----- Original Message ----- 
>   From: conrad_faber 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Wednesday, April 15, 2009 12:13 PM
>   Subject: [amibroker] Re: Gravity center mustafa Belkhayate
> 
> 
> 
> 
> 
>   Two questions remain:
> 
>   - How does one backtest such a system (future looking)?
>   - Can results be improved by Martingale strategy? (I understand averaging in is used by some professional traders) 
> 
>   Regards
>   Conrad
> 
>   --- In amibroker@xxxxxxxxxxxxxxx, "Edward Pottasch" <empottasch@> wrote:
>   >
>   > yes you are right. I know all this but it took a while for me to find out what they are actually doing. System seems to have quite a group of followers so I assumed that they know what they are doing. 
>   > 
>   > regards, Ed
>   > 
>   > 
>   > 
>   > 
>   > ----- Original Message ----- 
>   > From: Tomasz Janeczko 
>   > To: amibroker@xxxxxxxxxxxxxxx 
>   > Sent: Wednesday, April 15, 2009 11:07 AM
>   > Subject: Re: [amibroker] Re: Gravity center mustafa Belkhayate
>   > 
>   > 
>   > 
>   > 
>   > 
>   > 
>   > It is a matter whenever given filter is causal or not.
>   > 
>   > http://en.wikipedia.org/wiki/Causal_filter
>   > http://en.wikipedia.org/wiki/Causal_system
>   > 
>   > Acausal filter (like this Gravity center) looks into the future.
>   > 
>   > As any system that looks into the future, it will generate great results
>   > on paper, but will fail miserably in real trading.
>   > 
>   > Causal filters (like regular moving averages, EMAs, etc) are free from
>   > future leak, but because they are causal, they introduce delay. The delay
>   > causes profitability drop.
>   > 
>   > Best regards,
>   > Tomasz Janeczko
>   > amibroker.com
>   > ----- Original Message ----- 
>   > From: Edward Pottasch 
>   > To: amibroker@xxxxxxxxxxxxxxx 
>   > Sent: Wednesday, April 15, 2009 10:42 AM
>   > Subject: Re: [amibroker] Re: Gravity center mustafa Belkhayate
>   > 
>   > 
>   > link of the chart:
>   > 
>   > http://forex-strategies-revealed.com/files/pictures_strategies/cog_1s.png
>   > 
>   > 
>   > 
>   > 
>   > ----- Original Message ----- 
>   > From: Edward Pottasch 
>   > To: amibroker@xxxxxxxxxxxxxxx 
>   > Sent: Wednesday, April 15, 2009 10:38 AM
>   > Subject: Re: [amibroker] Re: Gravity center mustafa Belkhayate
>   > 
>   > 
>   > 
>   > they posted the rules somewhere and mentioned it should be of the 4-th order.
>   > 
>   > Found a chart posted that illustrates the repainting and shows what is wrong with the system. Originally the centre polynomial was heading down, turning up sharply when the market moved up ersing the original polynomial fit.
>   > 
>   > I do not understand why all these people are so happy about this system. Looks like an easy money maker until you find out that the polynomials change all the time.
>   > 
>   > rgds, Ed
>   > 
>   > 
>   > 
>   > 
>   > 
>   > ----- Original Message ----- 
>   > From: Ed Hoopes 
>   > To: amibroker@xxxxxxxxxxxxxxx 
>   > Sent: Wednesday, April 15, 2009 4:18 AM
>   > Subject: [amibroker] Re: Gravity center mustafa Belkhayate
>   > 
>   > 
>   > 4th degree - perhaps.
>   > 
>   > You can tell the degree by how many inflections there are in the plot of the indicator as follows:
>   > zero inflections - a straight line - linear regression line
>   > One inflection - a parabola - a quadratic equation 
>   > Two inflections - a cubic equation ax^3+bx^2+cx+d=0 Part way through the UTube video I saw two inflections.
>   > Three inflections - a 4th order polynomial can produce 3 changes in slope - inflections. I only saw two in the video.
>   > 
>   > As you get to higher order polynomials, the plots on the price graph look more and more like a simple moving average plot - but requiring much more computation.
>   > 
>   > ReefBreak
>   > 
>   > --- In amibroker@xxxxxxxxxxxxxxx, "Edward Pottasch" <empottasch@> wrote:
>   > >
>   > > seems this "centre of gravity" system is based on polynomial fit of the fourth degree. Seems to me that inherent to such a fit is repainting, meaning that when new information becomes available (new data) it will calculate a slightly different fit. Apparently some people made a version of this system that avoids repainting. Not sure yet how they do that. Also it seems that people seem to have success using the version of the system that repaints. I am not sure how people trade this when you can not do a reliable backtest.
>   > > 
>   > > rgds, Ed
>   > > 
>   > > 
>   > > 
>   > > 
>   > > 
>   > > ----- Original Message ----- 
>   > > From: Michel Guibert 
>   > > To: amibroker@xxxxxxxxxxxxxxx 
>   > > Sent: Tuesday, April 14, 2009 5:27 PM
>   > > Subject: RE: [amibroker] Re: Gravity center mustafa Belkhayate
>   > > 
>   > > 
>   > > 
>   > > 
>   > > 
>   > > 
>   > > Apparently this is the official code under metatrader
>   > > ========================================
>   > > 
>   > > #property indicator_chart_window 
>   > > #property indicator_buffers 7 
>   > > #property indicator_color1 Blue 
>   > > #property indicator_color2 DimGray 
>   > > #property indicator_color3 Red 
>   > > #property indicator_color4 Red 
>   > > #property indicator_color5 DimGray 
>   > > #property indicator_color6 LimeGreen 
>   > > #property indicator_color7 LimeGreen 
>   > > 
>   > > extern int Nmbr_Bars = 180; 
>   > > extern int Order = 3; 
>   > > extern double Ecart = 1.61803399; 
>   > > double g_ibuf_92[]; 
>   > > double g_ibuf_96[]; 
>   > > double g_ibuf_100[]; 
>   > > double g_ibuf_104[]; 
>   > > double g_ibuf_108[]; 
>   > > double g_ibuf_112[]; 
>   > > double g_ibuf_116[]; 
>   > > double gda_120[20][20]; 
>   > > double gda_124[20]; 
>   > > double gda_128[20]; 
>   > > double gda_132[20]; 
>   > > int gi_136; 
>   > > int gi_140; 
>   > > int gi_144; 
>   > > int gi_148; 
>   > > int gi_152; 
>   > > int gi_156; 
>   > > int gi_160; 
>   > > double gd_164; 
>   > > double gd_172; 
>   > > double gd_180; 
>   > > double gd_188; 
>   > > double gd_196; 
>   > > 
>   > > int init() { 
>   > > Comment("BARYCENTRE"); 
>   > > SetIndexStyle(0, DRAW_LINE); 
>   > > SetIndexBuffer(0, g_ibuf_92); 
>   > > SetIndexBuffer(1, g_ibuf_96); 
>   > > SetIndexBuffer(2, g_ibuf_100); 
>   > > SetIndexBuffer(3, g_ibuf_104); 
>   > > SetIndexBuffer(4, g_ibuf_108); 
>   > > SetIndexBuffer(5, g_ibuf_112); 
>   > > SetIndexBuffer(6, g_ibuf_116); 
>   > > return (0); 
>   > > } 
>   > > 
>   > > int deinit() { 
>   > > Comment(""); 
>   > > ObjectDelete("REG"); 
>   > > ObjectDelete("X1"); 
>   > > ObjectDelete("X2"); 
>   > > ObjectDelete("X3"); 
>   > > ObjectDelete("Z1"); 
>   > > ObjectDelete("Z2"); 
>   > > ObjectDelete("Z3"); 
>   > > return (0); 
>   > > } 
>   > > 
>   > > int start() { 
>   > > if (Year() >= 2010) return (0); 
>   > > datetime l_time_0 = 0; 
>   > > SetIndexDrawBegin(0, Bars - Nmbr_Bars - 1); 
>   > > SetIndexDrawBegin(1, Bars - Nmbr_Bars - 1); 
>   > > SetIndexDrawBegin(2, Bars - Nmbr_Bars - 1); 
>   > > SetIndexDrawBegin(3, Bars - Nmbr_Bars - 1); 
>   > > SetIndexDrawBegin(4, Bars - Nmbr_Bars - 1); 
>   > > SetIndexDrawBegin(5, Bars - Nmbr_Bars - 1); 
>   > > SetIndexDrawBegin(6, Bars - Nmbr_Bars - 1); 
>   > > if (l_time_0 != Time[0]) { 
>   > > ObjectDelete("REG"); 
>   > > ObjectDelete("X1"); 
>   > > ObjectDelete("X2"); 
>   > > ObjectDelete("X3"); 
>   > > ObjectDelete("Z1"); 
>   > > ObjectDelete("Z2"); 
>   > > ObjectDelete("Z3"); 
>   > > l_time_0 = Time[0]; 
>   > > } 
>   > > gi_152 = Order + 1; 
>   > > gda_124[1] = Nmbr_Bars + 1; 
>   > > for (gi_160 = 1; gi_160 <= gi_152 << 1 - 2; gi_160++) { 
>   > > gd_164 = 0; 
>   > > for (gi_156 = 0; gi_156 <= Nmbr_Bars; gi_156++) gd_164 += MathPow(gi_156, gi_160); 
>   > > gda_124[gi_160 + 1] = gd_164; 
>   > > } 
>   > > for (gi_160 = 1; gi_160 <= gi_152; gi_160++) { 
>   > > gd_164 = 0; 
>   > > for (gi_156 = 0; gi_156 <= Nmbr_Bars; gi_156++) { 
>   > > if (gi_160 == 1) gd_164 += (High[gi_156] + Low[gi_156]) / 2.0; 
>   > > else gd_164 += (High[gi_156] + Low[gi_156]) / 2.0 * MathPow(gi_156, gi_160 - 1); 
>   > > } 
>   > > gda_128[gi_160] = gd_164; 
>   > > } 
>   > > for (gi_140 = 1; gi_140 <= gi_152; gi_140++) { 
>   > > for (gi_136 = 1; gi_136 <= gi_152; gi_136++) { 
>   > > gi_144 = gi_136 + gi_140 - 1; 
>   > > gda_120[gi_136][gi_140] = gda_124[gi_144]; 
>   > > } 
>   > > } 
>   > > for (gi_144 = 1; gi_144 <= gi_152 - 1; gi_144++) { 
>   > > gi_148 = 0; 
>   > > gd_188 = 0; 
>   > > for (gi_136 = gi_144; gi_136 <= gi_152; gi_136++) { 
>   > > if (MathAbs(gda_120[gi_136][gi_144]) > gd_188) { 
>   > > gd_188 = MathAbs(gda_120[gi_136][gi_144]); 
>   > > gi_148 = gi_136; 
>   > > } 
>   > > } 
>   > > if (gi_148 == 0) return (0); 
>   > > if (gi_148 != gi_144) { 
>   > > for (gi_140 = 1; gi_140 <= gi_152; gi_140++) { 
>   > > gd_196 = gda_120[gi_144][gi_140]; 
>   > > gda_120[gi_144][gi_140] = gda_120[gi_148][gi_140]; 
>   > > gda_120[gi_148][gi_140] = gd_196; 
>   > > } 
>   > > gd_196 = gda_128[gi_144]; 
>   > > gda_128[gi_144] = gda_128[gi_148]; 
>   > > gda_128[gi_148] = gd_196; 
>   > > } 
>   > > for (gi_136 = gi_144 + 1; gi_136 <= gi_152; gi_136++) { 
>   > > gd_180 = gda_120[gi_136][gi_144] / gda_120[gi_144][gi_144]; 
>   > > for (gi_140 = 1; gi_140 <= gi_152; gi_140++) { 
>   > > if (gi_140 == gi_144) gda_120[gi_136][gi_140] = 0; 
>   > > else gda_120[gi_136][gi_140] = gda_120[gi_136][gi_140] - gd_180 * gda_120[gi_144][gi_140]; 
>   > > } 
>   > > gda_128[gi_136] = gda_128[gi_136] - gd_180 * gda_128[gi_144]; 
>   > > } 
>   > > } 
>   > > gda_132[gi_152] = gda_128[gi_152] / gda_120[gi_152][gi_152]; 
>   > > for (gi_136 = gi_152 - 1; gi_136 >= 1; gi_136--) { 
>   > > gd_196 = 0; 
>   > > for (gi_140 = 1; gi_140 <= gi_152 - gi_136; gi_140++) { 
>   > > gd_196 += (gda_120[gi_136][gi_136 + gi_140]) * (gda_132[gi_136 + gi_140]); 
>   > > gda_132[gi_136] = 1 / gda_120[gi_136][gi_136] * (gda_128[gi_136] - gd_196); 
>   > > } 
>   > > } 
>   > > for (gi_156 = 0; gi_156 <= Nmbr_Bars; gi_156++) { 
>   > > gd_164 = 0; 
>   > > for (gi_144 = 1; gi_144 <= Order; gi_144++) gd_164 += (gda_132[gi_144 + 1]) * MathPow(gi_156, gi_144); 
>   > > g_ibuf_92[gi_156] = gda_132[1] + gd_164; 
>   > > } 
>   > > gd_172 = iStdDev(NULL, 0, Nmbr_Bars, 0, MODE_SMA, PRICE_HIGH, 0) * Ecart; 
>   > > for (gi_156 = 0; gi_156 <= Nmbr_Bars; gi_156++) { 
>   > > g_ibuf_104[gi_156] = g_ibuf_92[gi_156] + gd_172; 
>   > > g_ibuf_100[gi_156] = g_ibuf_92[gi_156] + (g_ibuf_104[gi_156] - g_ibuf_92[gi_156]) / 1.382; 
>   > > g_ibuf_96[gi_156] = g_ibuf_92[gi_156] + (g_ibuf_100[gi_156] - g_ibuf_92[gi_156]) / 1.618; 
>   > > g_ibuf_116[gi_156] = g_ibuf_92[gi_156] - gd_172; 
>   > > g_ibuf_112[gi_156] = g_ibuf_92[gi_156] - (g_ibuf_92[gi_156] - g_ibuf_116[gi_156]) / 1.382; 
>   > > g_ibuf_108[gi_156] = g_ibuf_92[gi_156] - (g_ibuf_92[gi_156] - g_ibuf_112[gi_156]) / 1.618; 
>   > > } 
>   > > ObjectCreate("REG", OBJ_ARROW, 0, Time[0], g_ibuf_92[0]); 
>   > > ObjectSet("REG", OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE); 
>   > > ObjectSet("REG", OBJPROP_COLOR, Blue); 
>   > > ObjectCreate("X1", OBJ_ARROW, 0, Time[0], g_ibuf_96[0]); 
>   > > ObjectSet("X1", OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE); 
>   > > ObjectSet("X1", OBJPROP_COLOR, DimGray); 
>   > > ObjectCreate("X2", OBJ_ARROW, 0, Time[0], g_ibuf_100[0]); 
>   > > ObjectSet("X2", OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE); 
>   > > ObjectSet("X2", OBJPROP_COLOR, Red); 
>   > > ObjectCreate("X3", OBJ_ARROW, 0, Time[0], g_ibuf_104[0]); 
>   > > ObjectSet("X3", OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE); 
>   > > ObjectSet("X3", OBJPROP_COLOR, Red); 
>   > > ObjectCreate("Z1", OBJ_ARROW, 0, Time[0], g_ibuf_108[0]); 
>   > > ObjectSet("Z1", OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE); 
>   > > ObjectSet("Z1", OBJPROP_COLOR, DimGray); 
>   > > ObjectCreate("Z2", OBJ_ARROW, 0, Time[0], g_ibuf_112[0]); 
>   > > ObjectSet("Z2", OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE); 
>   > > ObjectSet("Z2", OBJPROP_COLOR, LimeGreen); 
>   > > ObjectCreate("Z3", OBJ_ARROW, 0, Time[0], g_ibuf_116[0]); 
>   > > ObjectSet("Z3", OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE); 
>   > > ObjectSet("Z3", OBJPROP_COLOR, LimeGreen); 
>   > > return (0); 
>   > > } 
>   > > 
>   > > 
>   > > 
>   > > 
>   > > 
>   > > ----------------------------------------------------------
>   > > Windows Live Messenger makes it easier to stay in touch - learn how!
>   > >
>   >
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/