原创2 3日江恩hilo线加rsi移动平均

Discussion in 'Wealth-Lab Developer' started by mydii, Mar 12, 2005.

  1. var Bar , RSIPane , RSIPER ,ShortPER , LongPER: integer;
    var SMAShort,SMALong : float;
    var HiSeries ,LoSeries : integer;
    var HighSum,LowSum,Hi,Lo,HighSum1,LowSum1 ,Hi1, Lo1: float;
    Hidevolume;
    const FMT = '0.00' ;
    const FMT1 = '0.0000';
    RSIPER :=14;
    ShortPER :=5;
    LongPER :=13;
    {3 days HiLo }
    //AddFutureBars(1);
    HiSeries := CreateSeries();
    LoSeries := CreateSeries();

    for Bar := 15 to BarCount()-1 do
    Begin
    HighSum := PriceHigh(Bar - 1) + PriceHigh(Bar - 2) + PriceHigh(Bar - 3);
    HighSum1 := PriceHigh(Bar - 2) + PriceHigh(Bar - 3) + PriceHigh(Bar - 4);
    Hi1 := HighSum1/3;
    Hi := HighSum / 3;
    //if Bar <> BarCount - 1 then
    //Begin
    DrawCircle(5,0,Bar,Hi,#green,#thin);
    DrawLine(Bar,Hi,Bar+1,Hi,0,#green,#thin);
    DrawLine(Bar,Hi1,Bar,Hi,0,#green,#thin);
    //End;
    //SetSeriesValue(Bar,HiSeries,Hi);
    LowSum := PriceLow(Bar - 1) + PriceLow(Bar - 2) + PriceLow(Bar - 3);
    LowSum1 := PriceLow(Bar - 2) + PriceLow(Bar - 3) + PriceLow(Bar - 4);
    Lo := LowSum / 3;
    Lo1 := LowSum1/3 ;
    //if Bar <> BarCount-1 then
    //Begin
    DrawCircle(5,0,Bar,Lo,826,#thin);
    DrawLine(Bar,Lo,Bar+1,Lo,0,826,#thin);
    DrawLine(Bar,Lo1,Bar,Lo,0,826,#thin);
    //End;
    //SetSeriesValue(Bar,LoSeries,Lo);
    End;
    //PlotSeries(HiSeries,0,826,6);
    //PlotSeries(LoSeries,0,826,6);
    DrawLabel('The Today Hi is = ' + FormatFloat(FMT1,Hi),0);
    DrawLabel('The Today Lo is = ' + FormatFloat(FMT1,Lo),0);


    {SMA for RSI}
    Bar := BarCount - 1;
    SMAShort := GetSeriesValue(Bar,SMASeries(RSISeries(#Close,RSIPER),ShortPER));
    SMALong := GetSeriesValue(Bar,SMASeries(RSISeries(#Close,RSIPER),LongPER));

    RSIPane :=CreatePane(100,false,true);
    PlotSeries(RSISeries(#Close,RSIPER),RSIPane,#Red,#Thick);
    PlotSeries(SMASeries(RSISeries(#Close,14),ShortPER),RSIPane,#Green,#Thin);
    PlotSeries(SMASeries(RSISeries(#Close,14),LongPER),RSIPane,#Blue,#Thin);
    DrawLabel('RSI '+ IntToStr(RSIPER) + ' Day Period', RSIPane);
    DrawLabel(IntToStr(ShortPER)+' Day Period SMA ='+ FormatFloat(FMT ,SMAShort) + ' Green',RSIPane);
    DrawLabel(IntToStr(LongPER)+' Day Period SMA ='+ FormatFloat(FMT ,SMALong) + ' Blue',RSIPane);
    DrawHorzLine(30,RSIPane,444,0);
    DrawHorzLine(70,RSIPane,444,0);
     
  2. 谢谢,能说明一下适用要领么?