Tradestation risk model(last trade profit)

rublizz

Newbie
Messages
3
Likes
0
Hi All,

I'm trying to code risk management with TS:
after unsuccessful trade increase contracts to buy.

Maybe someone have example?
Or can help how to find whether last trade was profitable or not?
 
Hi All,

I'm trying to code risk management with TS:
after unsuccessful trade increase contracts to buy.

Maybe someone have example?
Or can help how to find whether last trade was profitable or not?

what have you tried?
 
Hi,

Risk Management is something where you decrease the contracts(Not Increase) after an unsuccessful trade... and increasing contracts when there is a profitable trade...

Try the following code:
Code:
Var: MP(0), MyLastTradeProfit(0);
MP = Marketposition;

if MP = 0 and MP[1] <> 0 then begin
   if MP[1] = 1 then  MyLastTradeProfit = (ExitPrice(1) - EntryPrice(1)) * BigPointValue;
   if  MP[1] = -1 then MyLastTradeProfit = EntryPrice(1) - ExitPrice(1)* BigPointValue;
End;

Mani.
 
Top