PureBytes Links
Trading Reference Links
|
> dailyprofit=(netprofit+openpositionprofit)-cte;
> if d>d[1] then cte=netprofit;
I'd switch those around, so you don't calculate the first bar's
dailyprofit with yesterday's cte. But I don't think it will
matter, assuming you close all trades at the end of the day.
if d>d[1] then cte=netprofit;
dailyprofit=(netprofit+openpositionprofit)-cte;
TargetProfit = 1000;
ProfitNeeded = TargetProfit - dailyprofit;
if MarketPosition = 1 then
exitlong at EntryPrice + ProfitNeeded/BigPointValue limit;
if MarketPosition = -1 then
exitshort at EntryPrice - ProfitNeeded/BigPointValue limit;
Gary
|