Position sizing Method

noisytrader

Newbie
Messages
2
Likes
0
:clap: Hi I am trying to write the code in tradestation for position sizing og larry williams with series of winning and losing trades that wrote in this book http://www.amazon.com/Definitive-Guide-Futures-Trading-II/dp/0930233360 in the page 187 , or if you prefer you can obtain information about that in this manual in the page 64 http://www.adaptrade.com/MSA3UsersGuide.pdf .. can somebody help me with that code.. really i have tried it but is really impossible..

thanks my email is [email protected]
 
what have you tried?
can you post your code?
we can help you fix it.
 
ok this is the code

the problem is that the positionprofit i do not know if it runs well th idea is that 5 lossing trades add one contract all time and when appear one win trade begin to sustrac one every time that appear one win trade



Inputs:
Price1(Low),
Length1(10),
Price2(high),
Length2(10);

vars:
float Trade0(-90000),
float Trade1(-90000),
float Trade2(-90000),
float Trade3(-90000),
float Trade4(-90000),
TC(1);

Trade0 = PositionProfit ;
Trade1 = PositionProfit(1);
Trade2 = PositionProfit(2);
Trade3 = PositionProfit(3);
Trade4 = PositionProfit(4);


if Trade0 < 0 and Trade1 < 0 and Trade2 < 0 and Trade3 < 0 and Trade4 < 0 then TC =2;


If TC >1 then begin
if trade0 > 0 then
TC = TC + 1;
if Trade0 < 0 then
TC = currentcontracts - 1;
end;

if marketposition <>-1 then Sell Short TC contracts Next Bar at LowestFC(Price1, Length1) - 1 Point Stop;


if marketposition <>1 then Buy TC contracts Next Bar at HighestFC(Price2, Length2) + 1 Point Stop;
 
Top