اقتباس:
المشاركة الأصلية كتبت بواسطة ابوهياء001
السلام عليكم
اخواني ابي معادله الموشرات التاليه للولث لاب
مؤشر الـــ ( تربل بي )
عارف كثرت عليكم
بجاوبك بالي عندي
{$I 'BearPowerVG'}
{$I 'BullPowerVG'}
const SmoothBullBear = 20;
const SmoothBBB = 30;
var Bar, BullPane: integer;
var BullPowerVG1, BearPowerVG1: integer;
var BBB, BBBPane: integer;
{ Create Custom Chart Panes }
BullPane := CreatePane( 75, true, true );
BBBPane := CreatePane( 150, true, true );
{ Obtain and Plot the BullPower and BearPower, smoothed }
BullPowerVG1 := SMASeries( BullPowerVGSeries, SmoothBullBear );
PlotSeriesLabel( BullPowerVG1, BullPane, 050, #Thick, 'BullPower' );
BearPowerVG1 := SMASeries( BearPowerVGSeries, SmoothBullBear );
PlotSeriesLabel( BearPowerVG1, BullPane, 900, #Thick, 'BearPower' );
{ Calculate and Plot the smoothed BBB indicator }
BBB := SMASeries( SubtractSeries( BullPowerVG1, BearPowerVG1 ), SmoothBBB );
PlotSeriesLabel( BBB, BBBPane, #Navy, #ThickHist, 'BBB' );
{ Implement trading system rules }
for Bar := 60 to BarCount - 1 do
begin
SetSeriesBarColor( Bar, BBB, #Navy );
if MarketPosition = 0 then
begin
if
@BBB
[Bar] < 0 then
if TurnUp( Bar, BBB ) then
begin
SetSeriesBarColor( Bar, BBB, #Lime );
BuyAtMarket( Bar + 1, '' );
end;
end
else
begin
if
@BBB
[Bar] > 0 then
if TurnDown( Bar, BBB ) then
begin
SetSeriesBarColor( Bar, BBB, #Red );
SellAtMarket( Bar + 1, LastPosition, '' );
end;
end;
end;