script code from Wealth-lab to ProRealtime

jalaga

Newbie
Messages
2
Likes
0
Hello,
I have found the script showed below in this forum (Trader's Roundtable :: View topic - Portfolio Management.)
It goes fine into Wealth-lab software but when trying to copy and paste it into the ProrealTime builder I only get errors.
I have not skill on scripting programming language. Please, may any of you give some advise on how to make it works into ProRealtime?.

Thank you
Javier


{ This System takes advantage of future information!
It buys and sells at the market open on the same bar
that it examines closing price! }
var BAR: integer;
for Bar := 1 to BarCount - 1 do
begin
if LastPositionActive then
begin
if PriceClose( Bar ) < PriceClose( Bar - 1 ) then
SellAtMarket( Bar, LastPosition(), '');
end
else
begin
if PriceClose( Bar ) > PriceClose( Bar - 1 ) then
BuyAtMarket( Bar, '' );
end;
end;
 
Top