You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The Dipper
This is a Weathlab code that is most profitable listed on Wealthlab site. Can someone code in MT4, thank you.
var X, Y, C, BAR, Z: integer;
X := 200;
Y := 5;
C := 5000;
for Bar := (X + Y + 1) to BarCount() - 1 do
begin
if SMA( Bar, #Close, X ) < SMA( Bar - Y, #Close, X ) then
if ( PriceClose( Bar ) > PriceClose( Bar - Y ) ) then
if ( PriceClose( Bar ) < PriceClose( ( Bar - ( Y + X)) ) ) then
begin
If PositionLong ( LastPosition() ) then
begin
for Z := 0 to PositionCount() - 1 do
if PositionActive( Z ) then
SellAtMarket( Bar + 1, Z, '');
If PriceClose ( Bar ) >= 5 then
ShortAtMarket( Bar + 1, '');
end
else
if PositionCount() = 0 then
If PriceClose ( Bar ) >= 5 then
ShortAtMarket( Bar + 1, '');
end;
if SMA( Bar, #Close, X ) > SMA( Bar - Y, #Close, X ) then
if ( PriceClose( Bar ) < PriceClose( Bar - Y ) ) then
if ( PriceClose( Bar ) > PriceClose( ( Bar - ( Y + X)) ) ) then
begin
If PositionLong ( LastPosition() ) = False then
begin
for Z := 0 to PositionCount() - 1 do
if PositionActive( Z ) then
CoverAtMarket( Bar + 1, Z, '');
BuyAtMarket( Bar + 1, '');
end
else
if PositionCount() = 0 then
BuyAtMarket( Bar + 1, '');
end;
end;