mrsic8
 ( 9.50% )
- ago
Hello,

can someone help me with this code. How to translate in WL7?
The old one WL6:
CODE:
// PlotSeries(PricePane, (Close + ATR.Series(Bars, slider6.ValueInt) * slider7.Value) >> 1, Color.Green, LineStyle.Solid, 1);

WL7 i have tried:
CODE:
private TimeSeries _ATRcalcultion; ATRcalcultion = (ClosePosition(LastPosition + ATR.Series(bars,Parameters[6].AsInt * Parameters[7].AsInt))); //this won't work, Operator + cannot...

I think "PlotTimeSeries" can't be applied.
I am not a pro programmer, but i give my best.

regards
0
560
Solved
3 Replies

Reply

Bookmark

Sort
mrsic8
 ( 9.50% )
- ago
#1
I think I got it. Can someone tell me please, if it's right?

The Old one WL6:
CODE:
PlotSeries(PricePane, (Close + ATR.Series(Bars, slider6.ValueInt) * slider7.Value) >> 1, Color.Green, LineStyle.Solid, 1);


WL7
CODE:
public class Munich : UserStrategyBase { private TimeSeries _ATRcalcultion; public Munich() : base() { AddParameter("NoB_LG", ParameterTypes.Int32, 3, 1, 10, 1); AddParameter("LB_LG", ParameterTypes.Int32, 1, 1, 5, 1); AddParameter("StochD_LB_LG", ParameterTypes.Int32, 5, 1, 10, 1); AddParameter("StochD_Smoothing_LG", ParameterTypes.Int32, 2, 1, 10, 1); AddParameter("Stochd_LV_LG", ParameterTypes.Int32, 20, 16, 30, 1); AddParameter("ATR_LB_LG", ParameterTypes.Int32, 5, 1, 50, 1); AddParameter("ATR_Multiplier_LG", ParameterTypes.Int32, 1.8, 1.5, 5, 0.1); AddParameter("TBX_LG", ParameterTypes.Int32, 4, 1, 10, 1); AddParameter("NoB_ST", ParameterTypes.Int32, 4, 1, 10, 1); AddParameter("LB_ST", ParameterTypes.Int32, 1, 1, 5, 1); AddParameter("StochD_LB_ST", ParameterTypes.Int32, 5, 1, 10, 1); AddParameter("StochD_Smoothing_ST", ParameterTypes.Int32, 3, 1, 10, 1); AddParameter("Stochd_Level_ST", ParameterTypes.Int32, 80, 70, 90, 1); AddParameter("ATR_LB_ST", ParameterTypes.Int32, 5, 1, 50, 1); AddParameter("ATR_Multiplier_ST", ParameterTypes.Int32, 1, 0.5, 2, 0.1); AddParameter("TBX_ST", ParameterTypes.Int32, 3, 1, 10, 1); } //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { _tgtAtrLong = ATR.Series(bars, Parameters.FindName("ATR_LB_LG").AsInt); _tgtAtrShort = ATR.Series(bars, Parameters.FindName("ATR_LB_ST").AsInt); _ATRcalcultion = (bars.Close + ATR.Series(bars,Parameters[6].AsInt * Parameters[7].AsInt)); PlotIndicator((IndicatorBase) _ATRcalcultion, Color.BlueViolet, PlotStyles.Line, true );


Or is that also possible and shorter?
CODE:
PlotIndicator((IndicatorBase) (bars.Close + ATR.Series(bars, Parameters[6].AsInt * Parameters[7].AsInt)));
0
Glitch8
 ( 10.94% )
- ago
#2
Well this is a literal translation, but I don't know if it makes sense because the slider 7 parameter value is not used as an ATR period, it's just a multiplier??

CODE:
//Initialize public override void Initialize(BarHistory bars) {          int slider6Value = 5;          int slider7Value = 5;          TimeSeries atrCalc = (bars.Close + ATR.Series(bars, slider6Value) * slider7Value) >> 1;          PlotTimeSeries(atrCalc, "AtrCalc", "AtrCalc", Color.Green); }
0
Best Answer
mrsic8
 ( 9.50% )
- ago
#3
Hello Glitch,
thanks.

With the multiplier I can increase or decrease the volume.
0

Reply

Bookmark

Sort