Grail from A. Gorchakov

And here is the algorithm of a profitable trading system for SPY:

Writing code for WL quickly:

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
protected override void Execute()
{
for(int bar = 20; bar < Bars.Count; bar++)
{
if (IsLastPositionActive)
{
if (Close[bar] < Open[bar])
SellAtStop(bar+1, LastPosition, Math.Min(Open[bar], (High[bar] + Low[bar]) / 2));
}
else
{
if (Close[bar] > Open[bar])
if (High[bar] + Low[bar] > High[bar-1] + Low[bar-1])
BuyAtClose(bar);
}
}
}
}
}

Press the backtest button and see the result:

Strange. A. Gorchakov cannot be wrong. Probably, I was wrong or I, or WL …… :)
  Спасибо Жерар Саранский.....
Scroll to Top