Hello everyone.
First of all, thanks for a great forum. I’ve been snooping around the last month looking at different post, and I really like the tone in the post.
I have studied Technical Analysis for the past two years, when time was for it (yep, got small kids) and been trying different platforms. But it’s difficult to find a platform supporting Nordic stocks. I’m a novice regarding trading/investing and coding. I see myself as patient 😉 though I must admit that I’m stuck.
I’ve read through the forum and programming guide, but my skills are not sufficient enough :/
The code I would like help to converted is as follows:
(Metastock non-logical language)
Lower line = If(LinearReg(C,13)>PREV,If(LinearReg(C,13)-(ATR(13)*2.5)>PREV,LinearReg(C,13)-(ATR(13)*2.5),PREV),LinearReg(C,13));
This is supposed to draw a line under the price as a kind of visual stoploss line, but not trigger the stoploss function (only as a visual guidance).
I think the solution lies within page 17 in the probuilder guide (Bar index example), I just can’t figure it out :/
Thanks in advance!
/Tradeplan
Hi TradePlan, thanks for your good feedback about what happens here 🙂
I changed the topic title, please try to write something relevant regarding the discussion next time, otherwise we’ll get hundreds of “help with probuilder” topics.. 🙄
Your stoploss line code from Metastock could be translated as follow:
//Lower line = If(LinearReg(C,13)>PREV,If(LinearReg(C,13)-(ATR(13)*2.5)>PREV,LinearReg(C,13)-(ATR(13)*2.5),PREV),LinearReg(C,13));
lr = LinearRegression[13](close)
i=lr-averagetruerange[13]*2.5
if lr>lowerline[1] then
if i>lowerline[1] then
lowerline=i
else
lowerline=lowerline[1]
endif
else
lowerline=lr
endif
return lowerline
I have nothing to compare with, but it should do the trick. This SL line is only for long order as it seems.
Thank you very much Nicolas for the quick reply! It works perfect!
I’ve taken notice regarding the headline suggestion 😉
Thanks again.