Conversion Scalping Line Tradingview

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #211116 quote
    pejavikpejavik
    Participant
    Junior

    Hello,

    I am using the Scalping Line indicator on Tradingview and would like to convert this indicator to Prorealtime.

    As I have limited skills for programming in PRT I am hoping someone can help me.

    The code in Tradingview is as follows:

    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © KivancOzbilgic

    //@version=4
    study(“Scalping Line”, overlay=false)
    src = input(close, title=”Source”)
    percent = input(1.0,”Percent”, type=input.float, step=0.1, minval=0)
    mainperiod = input(100,”Main Period”)
    signalperiod = input(7,”Signal Period”)
    MA = sma(sma(src, ceil(mainperiod / 2)), floor(mainperiod / 2) + 1)
    ssMA = MA>close+MA*percent/100 ? MA : MA<close-MA*percent/100 ? MA : close
    signalline = sma(close,signalperiod)
    ScalpLine = signalline-ssMA

    k1=plot(ScalpLine,”SLI”,color.maroon,2)
    k2=plot(0,””)

    color1= ScalpLine>=0 ? color.green : color.red
    fill(k1,k2,color=color1,transp=80)
    alertcondition(crossover(ScalpLine,0), title=”BUY ALARM!”, message=”SLI BUY Signal!”)
    alertcondition(crossunder(ScalpLine,0), title=”SELL ALARM!”, message=”SLI SELL Signal!”)

    #211479 quote
    NicolasNicolas
    Keymaster
    Legend

    😆 Sorry this is ironic, because you ask me to convert the conversion of my own indicator I published here back in 2015: https://www.prorealcode.com/prorealtime-indicators/scalping-line-indicator/

    #211555 quote
    pejavikpejavik
    Participant
    Junior

    Thank you Nicolas, I have seen the code in that link and copied it into PRT.

    However I have completely different indicator as in Tradingview.

    I don’t understand why it is so different. Hope you can help me.

    #211570 quote
    NicolasNicolas
    Keymaster
    Legend

    Just use the same settings?

    Default ones are:

    percent = 1
    mainperiod = 100
    signalperiod = 7
    Are you comparing the same exact instrument?
Viewing 4 posts - 1 through 4 (of 4 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

Conversion Scalping Line Tradingview


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
pejavik @pejavik Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by NicolasNicolas
3 years, 6 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/08/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...