how to assign "fixed contract size" to variable
Posted: Jul 02 2015
Hey. I need to assign the "fixed contract size" from the strategy properties to a variable, so I can either use those or use my own contract size.
At the moment I've got the following code, so I need to write the "Buy" line two times.
It would be great I could assign the "fixed contract size" to a variable, so I can
At the moment I've got the following code, so I need to write the "Buy" line two times.
Code: Select all
inputs:
system.use.pool.position.sizing(true);
variables:
system.contracts(0);
system.contracts = 5;
if system.use.pool.position.sizing then begin
Buy system.contracts contracts next bar at market;
end else begin
Buy next bar at market;
end;
Code: Select all
if system.use.pool.position.sizing then begin
system.contracts = 5;
end else begin
system.contracts = "strategies properties settings";
end;
Buy system.contracts contracts next bar at market;