When I run the following code which should buy on the open and sell on the 
close of every bar. I get an anomolous short profit in Reports.

How can I corect this?

////////////////////////////////////////////////

//Buy On Open Sell On Close

SetTradeDelays( 0, 0, 0, 0 );
BuyPrice =  O;
SellPrice = C;


Buy=1;
Sell=1;
Plot( C, "C", colorBlack, styleCandle );

//////////////////////////////////////////
I have back test settings as follows
Initial Equity: 100000  Periodicity/Positions: Weekly/Long  
Commissions: 0.00 per trade  Annual interest rate: 5.00% 
Range: 29 bars  Apply to: Current Symbol 
Account margin: 100  Futures mode: No 
Def. round lot size: 0  Def. Tick Size 0.1 
Drawdowns based on: High/Low prices      
Long trades 
Buy price: Close  Sell price: Open 
Buy delay: 0  Sell delay: 0 
Short trades 
Short price: Close  Cover price: Close 
Short delay: 0  Cover delay: 0 
Stops 
Maximum loss: disabled  Profit target: disabled 
Value: 4.00  Value: 15.00 
Exit at stop? no  Exit at stop? no 
  
Trailing stop: disabled      
Value: 30.00      
Exit at stop? no      
////////////////////////////////////////////////

Report output when run on Symbol SPY 
                    All Trades       Long      Short
Initial capital     100000.00    100000.00     100000.00 
Ending capital       103068.32   103068.32     102764.42 
Net Profit             3068.32     3068.32       2764.42 
Net Profit             % 3.07     % 3.07        % 2.76 % 
Exposure              % 10.73      % 10.73      % 0.00 % 
Net Risk Adjusted Return % 28.59 % 28.59         % N/A  
Annual Return            % 5.56   % 5.56        % 5.00 % 
Risk Adjusted Return   % 51.77   % 51.77        % N/A  

--------------------------------------------------------------------------------
 
All trades               30     30 (100.00 %)    0 (0.00 %) 
 Avg. Profit/Loss       9.93     9.93              N/A 
 Avg. Profit/Loss      % 0.11    % 0.11          % N/A  
 Avg. Bars Held           1.00    1.00             N/A 


Reply via email to