Writing Custom Code For An Idea

{Example purposes only. Not for production}
Inputs:
tLb(200),
fLb(10),
sLbM(2);
Vars:
Trend(0);
If C > average(c,tLb) then trend = 99 else trend = -107;
If Trend > 0 then begin
If average(c,fLb) crosses below average(c,fLb * sLbM) then buy 10000/c shares next bar market; //If average(c,fLb) crosses above average(c,fLb * sLbM) then sell next bar market;
end;
If Trend < 0 then Sell next bar market;