BUY:
on 240 m tf :when stochastics 3,9,3.K > stochastics 3,9,3.D
then on 15m TF when stochastics 3,9,3 crosses above 20 then buy
SELL:
on 240 m tf :when stochastics 3,9,3.K < stochastics 3,9,3.D
then on 15m TF when stochastics 3,9,3 crosses below 80 then sell
I read online help guide, but my strategy does not work correctly. Can you write me , it is my code right? (check an attach)
protected override void Initialize()
{
SetProfitTarget("", CalculationMode.Ticks, Profit);
SetStopLoss("", CalculationMode.Ticks, Loss, false);
Add(PeriodType.Minute, 15);
Add(PeriodType.Minute, 240);
Add(Stochastics(3,9,3));
CalculateOnBarClose = false;
.
.
.
.
protected override void OnBarUpdate()
{
if (BarsInProgress == 1)
// Condition set 1
if (CrossAbove(Stochastics(BarsArray[0],3, 9, 3).K, 20, 1) && Stochastics(BarsArray[1],3,9,3).K[1] > Stochastics(BarsArray[1],3,9,3).D[1]);
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (CrossBelow(Stochastics(BarsArray[0],3, 9, 3).K, 80, 1) && Stochastics(BarsArray[1],3,9,3).K[1] < Stochastics(BarsArray[1],3,9,3).D[1]);
{
EnterShort(DefaultQuantity, "");
}
}
in attach is a screenshot
THANX for help

Comment