Below is code auto-generated by Price Action Lab:
input: ptarget(7), stopl(7);
variables: profitprice(0), stopprice(0);
if h[2] > h[0] AND h[0] > h[1] AND h[1] > c[0] AND c[0] > l[0] AND l[0] > l[2] AND l[2] > l[1] then begin
Buy Next Bar on the open;
if Marketposition = 0 then begin
profitprice = O of tomorrow * (1+ptarget/100);
stopprice = O of tomorrow * (1-stopl/100);
exitlong next bar at profitprice limit;
exitlong next bar at stopprice stop;
end;
end;
if marketposition= 1 then begin
profitprice= entryprice * (1 + ptarget/100);
stopprice= entryprice * (1 - stopl/100);
exitlong at profitprice limit;
exitlong at stopprice stop;
end;
Could anyone tell what the first check of Marketposition = 0 does exactly? Thanks.
input: ptarget(7), stopl(7);
variables: profitprice(0), stopprice(0);
if h[2] > h[0] AND h[0] > h[1] AND h[1] > c[0] AND c[0] > l[0] AND l[0] > l[2] AND l[2] > l[1] then begin
Buy Next Bar on the open;
if Marketposition = 0 then begin
profitprice = O of tomorrow * (1+ptarget/100);
stopprice = O of tomorrow * (1-stopl/100);
exitlong next bar at profitprice limit;
exitlong next bar at stopprice stop;
end;
end;
if marketposition= 1 then begin
profitprice= entryprice * (1 + ptarget/100);
stopprice= entryprice * (1 - stopl/100);
exitlong at profitprice limit;
exitlong at stopprice stop;
end;
Could anyone tell what the first check of Marketposition = 0 does exactly? Thanks.