Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inputs:monetary_risk(numericsimple), min_contr(numericsimple),max_contr(numericsimple),period_atr(numericsimple);
- if AvgTrueRange(period_atr)<> 0 then begin
- Value1= monetary_risk / (AvgTrueRange(period_atr) * bigpointvalue);
- if value1 > max_contr then value2 = max_contr else value2 = value1;
- if value2 < min_contr then value3 = min_contr else value3 = value2;
- end;
- Volatility_PS = value3;
- -------------------------------------------------------------------
- input: VPS(0), stop_loss(400), Risk(200);
- # c significa "close"
- if VPS = 0 then begin
- buy next bar at c + 1 * truerange stop;
- setstopposition;
- set stoploss(stop_loss);
- and;
- if VPS = 1 then begin
- buy Volatility_PS(Risk, 1, 10000000, 3) shares next bar at c + 1 * truerange stop;
- setstopposition;
- set stoploss(stop_loss);
- and;
- setexitonclose;
- -------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement