Help to draw a line under the price as a kind of visual stoploss line

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #106238 quote
    TradeplanTradeplan
    Participant
    New

    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

    #106243 quote
    NicolasNicolas
    Keymaster
    Legend
    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.
    Tradeplan thanked this post
    stoploss-line-indicator.png stoploss-line-indicator.png
    #106312 quote
    TradeplanTradeplan
    Participant
    New
    Thank you very much Nicolas for the quick reply! It works perfect! I’ve taken notice regarding the headline suggestion 😉 Thanks again.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Help to draw a line under the price as a kind of visual stoploss line


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Tradeplan @tradeplan Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by TradeplanTradeplan
7 years ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/02/2019
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...