Terlihat disini ada banyak script, script mana yg anda test ? _____
From: [email protected] [mailto:[email protected]] On Behalf Of Febry Hariyannugraha Sent: Monday, October 19, 2009 9:11 AM To: [email protected] Subject: Re: [ob] BW Chaos Theory's Balance Line VS PIG's Centreline....Re: Nanya profitunity .. Bahasanya bahasa Pascal Mbah .. Ini script-nya var Bench1, Bench2, Per1, Per2: integer; Bench1 := GetTickCount; const RedLineStop = true; const FiveConsecutiveColorBars = true; var Bar, P, AOPane, ACPane, GatorPane, AO, AC, BLGreen, BLRed, BLBlue, UpperGator, LowerGator, pMFI: integer; var HH, LL, HB, LB, UPFractal, DnFractal, Zone: integer; var UpFrac, DnFrac, PrevHigh, PrevLow, Tick: float; // Setup odds and ends Tick := GetTick; EnableTradeNotes(False, True, False); // Setup Panes AOPane := CreatePane(80, false, true); ACPane := CreatePane(80, false, true); GatorPane := CreatePane(80, false, true); // Calculate Balances Lines (Alligator) BLGreen := OffsetSeries(WilderMASeries(#Average, 5), -3); BLRed := OffsetSeries(WilderMASeries(#Average, 8), -5); BLBlue := OffsetSeries(WilderMASeries(#Average, 13), -8); // Calculate Market Facilitation Index (MFI) pMFI := DivideSeries(SubtractSeries(#High, #Low), #Volume); // Calculate Awesome Oscillator (AO) AO := SubtractSeries(SMASeries(#Average,5),SMASeries(#Average,34)); for Bar := 1 to BarCount - 1 do begin if @AO[Bar] > @AO[Bar-1] then SetSeriesBarColor(Bar, AO, #Lime) else SetSeriesBarColor(Bar, AO, #Red); end; // Calculate Accelerator (AC) AC := SubtractSeries(AO, SMASeries(AO, 5)); for Bar := 1 to BarCount - 1 do begin if @AC[Bar] > @AC[Bar-1] then SetSeriesBarColor(Bar, AC, #Lime) else SetSeriesBarColor(Bar, AC, #Red); end; // Calculate Gator (Balance Lines Spread) UpperGator := CreateSeries; LowerGator := CreateSeries; for Bar := 1 to BarCount - 1 do begin SetSeriesValue(Bar, UpperGator, abs(@blgreen[ba...@blred[bar])); if @UpperGator[Bar] > @UpperGator[Bar-1] then SetSeriesBarColor(Bar, UpperGator, #Lime) else SetSeriesBarColor(Bar, UpperGator, #Red); SetSeriesValue(Bar, LowerGator, -1*abs(@blred[ba...@blblue[bar])); if @LowerGator[Bar] < @LowerGator[Bar-1] then SetSeriesBarColor(Bar, LowerGator, #Lime) else SetSeriesBarColor(Bar, LowerGator, #Red); end; // Calculate Fractals HH := HighestSeries(#High, 3); HB := HighestBarSeries(#High, 3); LL := LowestSeries(#Low, 3); LB := LowestBarSeries(#Low, 3); UpFractal := CreateSeries; DnFractal := CreateSeries; for Bar := 0 to BarCount - 3 do begin if (@HB[Bar] = Bar) and (@HH[Bar+2] = @#High[Bar]) and (@HB[Bar+1]<>Bar+1) then begin AnnotateBar('^', Bar, True, #Blue, 15); UpFrac := @#High[Bar]; end; @UpFractal[Bar] := UpFrac; end; for Bar := 0 to BarCount - 3 do begin if (@LB[Bar] = Bar) and (@LL[Bar+2] = @#Low[Bar]) and (@LB[Bar+1]<>Bar+1) then begin AnnotateBar('v', Bar, False, #Red, 13); DnFrac := @#Low[Bar]; end; @DnFractal[Bar] := DnFrac; end; //PlotSeries(UpFractal, 0, #GREEN, #Thick); //PlotSeries(DnFractal, 0, #Blue, #Thick); // Calculate Bar Colors & Arrays Zone := CreateSeries; for Bar := 1 to BarCount - 1 do begin if (@AO[Bar] > @AO[Bar-1]) and (@AC[Bar] > @AC[Bar-1]) then begin SetBarColor(Bar, #Green); @Zone[Bar] := 1; end else if (@AO[Bar] < @AO[Bar-1]) and (@AC[Bar] < @AC[Bar-1]) then begin SetBarColor(Bar, #Red); @Zone[Bar] := -1; end else if (@pMFI[Bar] < @pMFI[Bar-1]) and (Volume(Bar) > Volume(Bar-1)) then begin SetBarColor(Bar, #Black); end else begin SetBarColor(Bar, #Silver); @Zone[Bar] := 0; end; end; // Calculate AO Signal arrays for Bar := 20 to BarCount - 1 do begin if CrossUnderValue(Bar, AO, 0) then PrevLow := 0; if CrossOverValue(Bar, AO, 0) then PrevHigh := 0; if @AO[Bar] < 0 then begin if TurnUp(Bar, AO) then begin if @AO[Bar-1] > PrevLow then AnnotateBar('O', Bar, False, #Lime, 8) else begin PrevLow := @AO[Bar-1]; end; end; end; if @AO[Bar] > 0 then begin if TurnDown(Bar, AO) then begin if @AO[Bar-1] < PrevHigh then AnnotateBar('O', Bar, True, #Red, 8) else begin PrevHigh := @AO[Bar-1]; end; end; end; end; // Plot and label series PlotSeries(BLGreen, 0, #Lime, #Thick); PlotSeries(BLRed, 0, #Red, #Thick); PlotSeries(BLBlue, 0, #Blue, #Thick); PlotSeries(AO, AOPane, #Blue, #ThickHist); PlotSeries(AC, ACPane, #Blue, #ThickHist); PlotSeries(UpperGator, GatorPane, #Blue, #ThickHist); PlotSeries(LowerGator, GatorPane, #Blue, #ThickHist); DrawLabel('AO', AOPane); DrawLabel('AC', ACPane); DrawLabel('Gator', GatorPane); function AOSaucerLong(Bar: integer): boolean; begin if TurnUp(Bar, AO) and (@AO[Bar-Per1] > @AO[Bar-Per2]) then Result := true else Result := false; end; function AOCrossOverLong(Bar: integer): boolean; begin if CrossOverValue(Bar, AO, 0) then Result := true else Result := false; end; function AOTwinPeaksLong(Bar: integer): boolean; begin if CrossOverValue(Bar, AO, 0) then Result := true else Result := false; end; // Main System Logic for Bar := 50 to BarCount - 1 do begin if AOSaucerLong(Bar) then BuyAtStop(Bar + 1, @#High[Bar]+Tick, 'AO Saucer Buy'); if AOCrossOverLong(Bar) then BuyAtStop(Bar + 1, @#High[Bar]+Tick, 'AO Cross 0 Buy'); // Manage positions for P := 0 to PositionCount - 1 do begin if PositionActive(P) then begin if FiveConsecutiveColorBars then begin if PositionLong(P) then if Lowest(Bar, Zone, 5) = 1 then SellAtMarket(Bar + 1, P, '5 Color Bars Stop'); end; end; if PositionActive(P) then begin if RedLineStop then begin if PositionLong(P) then SellAtStop(Bar + 1, @BLRed[Bar], P, 'Red Line Stop'); end; end; end; end; Bench2 := GetTickCount; PrintStatus('Executed in ' + IntToStr(Bench2-Bench1) + ' ms.'); hidevolume ; ---------------------------------------------------------------------------- ------------------------- Untuk member yang lain yang mengerti Pascal mungkin bisa minta viewnya .. Thanks.

