In TS I use this code :
If close > highest(close,10)[1] then
How to code in C# in WL ?
If close > highest(close,10)[1] then
How to code in C# in WL ?
Rename
CODE:
if(bars.Close[idx] >= Highest.Series(bars.High, 10)[idx - 1])
The whole strategy in TS looks like this :
If close > highest(close,10)[1] then buy this bar on close;
If close < lowest(close,10)[1] then sell short this bar on close;
How could I code this with WL ?
If close > highest(close,10)[1] then buy this bar on close;
If close < lowest(close,10)[1] then sell short this bar on close;
How could I code this with WL ?
We have already answered a similiar question to you:
Stop and Reverse strategy question
Experiment with the code provided by @Cone, replacing the close above/below conditions with the line above.
Stop and Reverse strategy question
Experiment with the code provided by @Cone, replacing the close above/below conditions with the line above.
When I replace
"if (qqq.Close[idx + 1] > qqq.Close[idx - 2])"
with
"if(qqq.Close[idx] >= Highest.series(qqq.Close)[idx - 1])"
I get the error "no definition for "series".
"if (qqq.Close[idx + 1] > qqq.Close[idx - 2])"
with
"if(qqq.Close[idx] >= Highest.series(qqq.Close)[idx - 1])"
I get the error "no definition for "series".
Why introduce absolutely unnecessary errors (that my Post #1 doesn't contain) by typing it when you can simply copy and paste that code? 🤷♂️ C# is case sensitive.
Same error if I copy and paste !
if(bars.Close[idx] >= Highest.Series(bars.High)[idx - 1])
if(bars.Close[idx] >= Highest.Series(bars.High)[idx - 1])
OK, I missed the period (10). Post #1 edited. Please retry.
Thank You !
Now it works.
Now it works.
Your Response
Post
Edit Post
Login is required