Max percent risk and shorting
Author: armand453
Creation Date: 8/3/2011 7:38 PM
profile picture

armand453

#1
Hi, I have some problems to implement a RiskStopLevel with my strategy. In my strategy I use a moving average as stop, if the close price cross the moving averageI close my position, I've tried to add befor my buy rules and sell rules a riskstoplevel to do so i've just entered one before buying (close - movingaverage) and one before shorting (movingaverage-close), but when I launch my backtest it tell me that I have insufficient capital to take some trades; and when I go in detail I've seen that it didn't take any short trade, but didn't have this problem with the long one, is there something special to do for shorting?
profile picture

Eugene

#2
Hi, please post the Strategy code here for analysis.
profile picture

armand453

#3
Here is the code

CODE:
Please log in to see this code.


Thanx for your help.
profile picture

Cone

#4
The RiskStopLevel is the level at which you'll take the stop, i.e., exit the Position.

If the stop level is the moving average, then you should assign the moving average's value to the RiskStopLevel.

CODE:
Please log in to see this code.
profile picture

armand453

#5
Ahh thanx believed that I had to enter the number of points we can lost potentially