{
ѧԺͶʿγϵаԴ
ѧԺȨ
ڽѧĿģϽתӯĿģΥ߱ؾ
C) Plouto-Quants All Rights Reserved

ѧԺ΢ţniuxiaomi3
}

Variables: var0(0), var1(0), kline(0), dline(0);
Variables: avgPriceBuy(0), avgVol(0), avgPriceExit(0);

// KDֵKDJָ꣬Ϊ1433
value1 = Stochastic(High, Low, Close, 14, 3, 3, 1, var0, var1, kline, dline);

// 10ռ۸ߣ20ռ۸ߣ10ճɽֵ
avgPriceBuy = Average(Close, 10);
avgVol = Average(Volume, 10);
avgPriceExit = Average(Close, 20);

// KϴDͬʱճɽ10վ̴ֵ10̼ʱ
if (kline > dline and kline[1] <= dline[1] and Volume > avgVol and Close > avgPriceBuy) then
    buy 1 contract at this bar close;

// ̼۸20վʱ
if (Close < AvgPriceExit) then sell at this bar close;
