Leveraged Trading – Robert Carver
Forums › ProRealTime English forum › ProBuilder support › Leveraged Trading – Robert Carver
- This topic has 5 replies, 2 voices, and was last updated 5 years ago by grimweasel47.
-
-
01/09/2020 at 5:03 PM #116319
Hi All.
If you’ve not read Leveraged Trading by Robert Carver yet I would commend you to do so. Ex PM at AHL Hedge Fund in London so he knows his onions!
I’m trying to build a simple breakout indicator that he demonstrates in his book. It’s a rolling max/min indicator based on ‘n’ days (either 10, 20,40,80,160 or 320)
The formula is as below (for n=10 days)
n=10
A= 10 day rolling high
B = 10 day rolling low
C = average of A + B
Scaled price = (Todays price minus – C) / (A-B)
The output ideally would be the bands over the price (akin to Donchian Channel) and the lower indicator shows range from 1 to -1.
Example (in Google Docs):
Many thanks in advance!
01/09/2020 at 6:08 PM #116329The output ideally would be the bands over the price (akin to Donchian Channel) and the lower indicator shows range from 1 to -1.
I’m not sure of what you mean by the above. An image of how the indicator should look would be helpful.
The following should calculate your scaled price (not tested):
123456789n=10a = highest[n](high)b = lowest[n](low)c = (a+b)/2scaledprice = (close-c)/(a-b)return scaledprice01/11/2020 at 4:29 PM #116435Hi Vonasi
The scaled price would vary between 0.5 and minus 0.5. max and minimum. So I was thinking as well as the breakout channel that the above calculations would draw (max, average and min) over the price chart, the lower indicator panel would show the actual scaled price value ranging between +0.5 and -0.5? Is this possible?
01/11/2020 at 5:19 PM #116444So you are saying that you want three lines on the price chart showing a, b and c?
I guess that the highest and lowest should not then include the current still forming candle? So if n=10 then it should be checking for the lowest and highest in the previous 10 candles. This way we can see a breakout of the upper and lower lines.
Does the separate scaled price indicator need to consider the current still forming candle? I guess it would.
The only way to do what you want is to create two separate indicators. One is applied to the price chart and the other is added as a separate indicator.
01/11/2020 at 5:24 PM #116446Here you go? (not tested).
If you want the lines to include the current candle then just change [1] to [0] after high and low in the code.
Add to price chart1234567n=10a = highest[n](high[1])b = lowest[n](low[1])c = (a+b)/2return a as "max", b as "min", c as "avg"Add as separate indicator123456789n=10a = highest[n](high[0])b = lowest[n](low[0])c = (a+b)/2scaledprice = (close-c)/(a-b)return scaledprice as "scaled price"01/11/2020 at 8:22 PM #116460Super thanks Vonasi. Great help. I’m just trying to see what this produces in a backtest with a simple MA rule (as Carver suggests). It seems many of the CTA’s use very simple trend following models trying to catch the meat of the trend systematically rather than over-fit a great backtested model that fails to work in reality!
Carver, Clenow et al, are all using Python with the Pandas package these days for back testing etc. I really need to start learning how to code that!
Thanks again. Great help.
Grim
-
AuthorPosts
Find exclusive trading pro-tools on