//------------------------------------------------------------------------ // 简称:PAH // 名称:PriceActionHelper // 类别: 交易指令 // 类型: 用户应用 //------------------------------------------------------------------------ Params //参数定义 Integer BarColor(2); Bool BarCount_FromNight(True); Integer BarCount_Interval(2); Bool BodyGap_Display(True); Integer Ema1_Length(20); Integer Ema2_Length(50); Integer Ema3_Length(220); GlobalVars //全局变量定义 Integer count(0); Integer bar(0); Vars //局部变量定义 Begin //策略执行区 // bk Color 21 25 36 If (BarColor == 1){ If (Open > Close){ ColorBar(Rgb(242, 54, 69)); } If (Open < Close){ ColorBar(Rgb(8, 153, 129)); } }Else If(BarColor == 2){ ColorBar(Rgb(128, 128, 128)); } //Bar Count Numeric i = EMA(High - Low, 169) / 2.618; If (bar != CurrentBar){ If (BarCount_FromNight) { If (Hour != 14 and Hour[1] == 14){ count = 0; } }Else{ If (Day != Day[1]){ count = 0; } } count += 1; bar = CurrentBar; } If (BarCount_Interval > 0){ If (count % BarCount_Interval == 0){ PlotText(Low - i, Text(count), 0, Rgb(245, 127, 23)); } } //Body Gap If (BarStatus != 2 And BodyGap_Display){ If (Low > High[2]){ //Bull Body Gap Integer Color = Rgb(8, 153, 129); Numeric Price = (High[2] + Low) / 2; PartLine("Bull", 0, Price, 2, Price, Color, 5); } If (High < Low[2]){ //Bear Body Gap Integer Color = Rgb(242, 54, 69); Numeric Price = (Low[2] + High) / 2; PartLine("Bear", 0, Price, 2, Price, Color, 5); } } //Ema if (Ema1_Length != 0){ PlotNumeric("Ema5m", EMA(Close, Ema1_Length), Rgb(255, 152, 0)); } if (Ema2_Length != 0){ PlotNumeric("Ema15m", EMA(Close, Ema2_Length), Rgb(128, 128, 0)); } if (Ema3_Length != 0){ PlotNumeric("Ema1h", EMA(Close, Ema3_Length), Rgb(120, 123, 134)); } End