Testing out new strategy.. please give input ( The Środek Strategy )

Hey everyone. Long time no see!

Anyway I have been doing a lot of studying on the markets as always and have started experimenting with the Center of Gravity theory ( Which I do believe in and was in a way part of my Stat arb trading strategy that took off ) Even though I still fully believe in stat arb I understand it may just be nearly impossible to implement profitably.

Now if you are familiar with Center of Gravity theory you would know that the regression curve follows price and “repaints” making back testing impossible to determine and forward testing honestly just as hard.

But even after failing multiple times at the traditional Center of Gravity trading style I started thinking differently and widening my stops and lowering my risk.

My strategy involves using a polynomial regression curve that does not repaint. The one I use is called JB Center of gravity and you can find it by just using a google search.

I add the center of gravity to my charts and it almost plots a Moving average / Bollinger band like line. The center line of course is the COG and the outer bands are Standard Deviations. I then add a 400 Linear weighted MA to the price as well as a 15 linear weighted MA to the price.

Now my theory is when the center of gravity or the actual weight of the currency is over the 400 period average price has made a significant reversal and will keep going until it runs out of inertia and the reverses and so on and so forth. [B]5 Min time frame BTW![/B]

I also have widened my stops and change my lot size according to my SL. Some of the trades end up being a 1:1 RR ratio and others are a 1:10 RR ratio.

As you can see by my chart it has been very successful at getting you in the trade very close to the true market direction change.

Over the last few weeks it has caught nearly every true price reversal near the peak.

I call this [B][B]The Środek Strategy[/B][/B]

Follow me on instagram @ wolfoftheinterbank

-Kelton

plz share ur indi and template.post more chart

Kelton, long time no see! Great to see you again! Anyway, when I googled it, there appears to be different versions of JB centre of gravity. How do we ensure we are getting the correct one? Also, what are your parameters for Bollinger Bands, and should our linear weighted MA be applied to close, open or median? without distinct parameters and entering/exiting rules to follow, it is hard for us to do testing too.

[QUOTE=“menpowerup;621752”]Kelton, long time no see! Great to see you again! Anyway, when I googled it, there appears to be different versions of JB centre of gravity. How do we ensure we are getting the correct one? Also, what are your parameters for Bollinger Bands, and should our linear weighted MA be applied to close, open or median? without distinct parameters and entering/exiting rules to follow, it is hard for us to do testing too.[/QUOTE]

Hey man, there are actually no bollinger bands. That’s just what the center of gravity indicator looks like. I set the linear weighted to close. Here is the actual code of the cog indicator. I also set it to 1500 bars back instead of 240 but leave everything the same.

You will buy when the cog middle line crosses above the 400 ma and the 15 ma has also crossed the 400 ma. And the reverse for a short.

//±-----------------------------------------------------------------+
//| JB Center of Gravity.mq4 |
//| |
//| Original Code from <[email protected]> |
//| Modification written by Jürgen Bouché |
//| This is the no repainting variant of the COG indicator. |
//| |
//| http://juergen.bouche.de |
//±-----------------------------------------------------------------+
#property copyright “[email protected] and Jürgen Bouché”
#property link “http://juergen.bouche.de

#property indicator_chart_window
#property indicator_buffers 5
#property indicator_color1 RoyalBlue
#property indicator_color2 LimeGreen
#property indicator_color3 LimeGreen
#property indicator_color4 Goldenrod
#property indicator_color5 Goldenrod

extern int bars_back = 240;
extern int m = 4;
extern int i = 0;
extern double kstd = 1;

double fx[], sqh[], sql[], stdh[], stdl[];
double ai[10,10], b[10], x[10], sx[20];
double sum;
int p, n, f;
double qq, mm, tt;
int ii, jj, kk, ll, nn;
double sq, std;

//±-----------------------------------------------------------------+
//| expert initialization function |
//±-----------------------------------------------------------------+
int init()
{
IndicatorShortName(“JB Center of Gravity”);
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, fx);
SetIndexBuffer(1, sqh);
SetIndexBuffer(2, sql);
SetIndexBuffer(3, stdh);
SetIndexBuffer(4, stdl);

nn = m + 1;

return(0);
}
//±-----------------------------------------------------------------+
//| expert deinitialization function |
//±-----------------------------------------------------------------+
int deinit()
{
return(0);
}
//±-----------------------------------------------------------------+
//| expert start function |
//±-----------------------------------------------------------------+
int start()
{
int mi;

p = bars_back;
sx[1] = p + 1;

int iBarsToCalculate = 0;
int iCountedBars = IndicatorCounted();
if(iCountedBars < 0) return(-1);
if(iCountedBars > 0) iCountedBars–;

iBarsToCalculate = Bars - iCountedBars;

for(i = 0;i < iBarsToCalculate;i++)
{
// ±----+ SX ±----+
for(mi = 1; mi <= nn * 2 - 2; mi++)
{
sum = 0;
for(n = i; n <= i + p; n++)
{
sum += MathPow(n, mi);
}
sx[mi + 1] = sum;
}
// ±----+ SYX ±----+
for(mi = 1; mi <= nn; mi++)
{
sum = 0.00000;
for(n = i; n <= i + p; n++)
{
if(mi == 1)
sum += Close[n];
else
sum += Close[n] * MathPow(n, mi - 1);
}
b[mi] = sum;
}
// ±----+ MATRIX ±----+
for(jj = 1; jj <= nn; jj++)
{
for(ii = 1; ii <= nn; ii++)
{
kk = ii + jj - 1;
ai[ii, jj] = sx[kk];
}
}
// ±----+ GAUSS ±----+
for(kk = 1; kk <= nn - 1; kk++)
{
ll = 0; mm = 0;
for(ii = kk; ii <= nn; ii++)
{
if(MathAbs(ai[ii, kk]) > mm)
{
mm = MathAbs(ai[ii, kk]);
ll = ii;
}
}
if(ll == 0)
return(0);

     if(ll != kk)
     {
        for(jj = 1; jj &lt;= nn; jj++)
        {
           tt = ai[kk, jj];
           ai[kk, jj] = ai[ll, jj];
           ai[ll, jj] = tt;
        }
        tt = b[kk]; b[kk] = b[ll]; b[ll] = tt;
     }  
     for(ii = kk + 1; ii &lt;= nn; ii++)
     {
        qq = ai[ii, kk] / ai[kk, kk];
        for(jj = 1; jj &lt;= nn; jj++)
        {
           if(jj == kk)
              ai[ii, jj] = 0;
           else
              ai[ii, jj] = ai[ii, jj] - qq * ai[kk, jj];
        }
        b[ii] = b[ii] - qq * b[kk];
     }
  }  
  x[nn] = b[nn] / ai[nn, nn];
  for(ii = nn - 1; ii &gt;= 1; ii--)
  {
     tt = 0;
     for(jj = 1; jj &lt;= nn - ii; jj++)
     {
        tt = tt + ai[ii, ii + jj] * x[ii + jj];
        x[ii] = (1 / ai[ii, ii]) * (b[ii] - tt);
     }
  }

  /*for(n = i; n &lt;= i + p; n++)
  {
     sum = 0;
     for(kk = 1; kk &lt;= m; kk++)
     {
        sum += x[kk + 1] * MathPow(n, kk);
     }
     fx[n] = x[1] + sum;
  }*/
  sum = 0;
  for(kk = 1; kk &lt;= m; kk++)
  {
     sum += x[kk + 1] * MathPow(i, kk);
  }
  fx[i] = x[1] + sum;

  sq = 0.0;
  /*for(n = i;n &lt;= i + p;n++)
  {
     sq += MathPow(Close[n] - fx[n], 2);
  }*/
  for(n = i;n &lt;= i + p;n++)
  {
     sum = 0;
     for(kk = 1; kk &lt;= m; kk++)
     {
        sum += x[kk + 1] * MathPow(n, kk);
     }
     sq += MathPow(Close[n] - (x[1] + sum), 2);
  }
  sq = MathSqrt(sq / (p + 1)) * kstd;
  std = iStdDev(NULL,0,p,MODE_SMA,0,PRICE_CLOSE,i) * kstd;
  /*for(n = i; n &lt;= i + p; n++)
  {
     sqh[n] = fx[n] + sq;
     sql[n] = fx[n] - sq;
     stdh[n] = fx[n] + std;
     stdl[n] = fx[n] - std;
  }*/
  sqh[i] = fx[i] + sq;
  sql[i] = fx[i] - sq;
  stdh[i] = fx[i] + std;
  stdl[i] = fx[i] - std;

}

return(0);
}
//±-----------------------------------------------------------------+^

sorry bro, but how do you incorporate this into a script for use? went to the website that you posted but I cannot see any link I can download from.

[QUOTE=“menpowerup;621777”]sorry bro, but how do you incorporate this into a script for use? went to the website that you posted but I cannot see any link I can download from.[/QUOTE]

Hey man, I’m not sure what link your talking about. Except the one in my last post. But the entire last post was the mq4 code for that indicator. You would copy that entire post and save it as a custom indicator using your metadata program in mt4.

sorry dude, but i got some problems. I opened the Meta Editor. Using the MQL wizard, I cannot copy paste into the parameter box. how do u do this?

Hi Kelton,

interesting idea. could you please post a template and we can see your setting then.)JB Center of Gravity settings+MACD …) THX.
regards

[QUOTE=“killerno;621805”]Hi Kelton, interesting idea. could you please post a template and we can see your setting then.)JB Center of Gravity settings+MACD …) THX. regards[/QUOTE]

Hey I will post my template as soon as I can. But I only use moving averages and the center of gravity. But no macd

Hi Kelton,

thanks. sorry I wanted to write MA, not MACD. I just added them to my chart, but I get different lines. Just share your template file please on filedropper or any site and after we could test it also.
Thx

[QUOTE=“killerno;621814”]Hi Kelton, thanks. sorry I wanted to write MA, not MACD. I just added them to my chart, but I get different lines. Just share your template file please on filedropper or any site and after we could test it also. Thx[/QUOTE]

I will. I’m just using my phone right now so I can’t upload anything.

Hi Kelton,

thx in advance!!

regards

Kelton, we’re rooting for you to post the template!
Very interested!

Here is another pic of what my chart looks like.

I dont know why I had the Main red Moving average set to 360 but it should be set to 400

Hey Kelton, thanks for the upload! now how do we determine when to enter or exit? once the lines cross each other? How do we use the COG to determine the inertia?

[QUOTE=“menpowerup;622315”]Hey Kelton, thanks for the upload! now how do we determine when to enter or exit? once the lines cross each other? How do we use the COG to determine the inertia?[/QUOTE]

I’m experimenting with different take profit strategies but in any case you will open a position when the middle cog line crosses the 400 moving average and the 15 moving average also crosses the 400.

Now if the price swings up quickly to or close to the outer bands of the center of gravity and then the cog line crosses over I will not open a position.

Hi there, I’m new in forex. So please guide me and I’m willing to learn as much as I can.

Thanks for the script. I will copy it to my meta trader