- Katılım
- 23 Eki 2020
- Mesajlar
- 1,802
Then copy this crude code in: |
|
Volatility Breakout System Commission:=21; {for Buy+Sell+Stop} TradeAmt:=10000; Buy:=O+((Ref(H,-1)-Ref(C,-1))*.7); Sell:=C; Stop:=O; Trade:= O < Ref(C,-1) AND H > Buy AND Ref(C,-1) < Ref(C,-2) AND Ref(C,-2) < Ref(C,-3) AND Ref(C,-3) < Ref(C,-4); {Trigger for Trade} HitStop:= If(Trade AND Stop>=Sell,TRUE,FALSE); {Have we hit our Stop} TradeSize:= TradeAmt/Buy; Profit:=If(Trade,-Commission-TradeSize*Buy,0);{Purchase} Profit:=If(HitStop=TRUE,{then} Profit+Stop*TradeSize, {else} If(Trade AND HitStop=FALSE, {then} Profit+Sell*TradeSize,0)); {Sale} Win:=If(Profit>0,1,0); Loss:=If(Profit<0,1,0); Cum(Profit) |
The indicator charts your profit. You just have to set the first 6 variablesas per your system. The MS If structures are a pain and I'm sure there mustbe easier ways to do this. This is also my first attempt to prove if it works. If you then create an Expert Advisor with the following in the Commentary definition, you'll get some summary statistics for the system. | |
| |
Source / From: |