PRC Q trend

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #224235 quote
    FahadFahad
    Participant
    New

    Hi ,

    I want to add system on the PRC Q trend indictor .

    Attached .

    PRC_Q-Trend.itf
    #224237 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You can, what are the conditions for that system?

    #224240 quote
    FahadFahad
    Participant
    New

    Thanks for reply,

    5M chart

    buy (next ber ) once the the green ▲showing .

    sell (next ber ) once the red ▼ showing .

    Target 3 point

    SL 5 point

    if that possible to make it edit by my self to test it with different risk managment

    #224243 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Do you need an indicator or a strategy?

    #224244 quote
    FahadFahad
    Participant
    New

    strategy,

    i want to trade auto based on the signels .

    the indictor slredy available as the attached .

    PRC_Q-Trend-1.itf
    #225526 quote
    Jean FXJean FX
    Moderator
    Junior

    Here you have an exemple.
    However, as the symbols are drawn in the past, there is a time lag between the signal and the backtest position (position taken 2 candlesticks after the one on which the signal is drawn).

    
    //PRC_Q-Trend | indicator
    //17.07.23
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // ---settings
    p = 200 //Trend period
    atrp = 14 //ATR Period
    mult = 1.0 //ATR Multiplier
    mode = 1 //Signal mode options = [1="Type A", 2="Type B"]
    useemasmoother = 0 //Smooth source with EMA? 0=false ; 1=true
    srcemaperiod = 3 //EMA Smoother period
    colorbars = 0 //Color bars? 0=false ; 1=true
    signalsview = 0 //0 = trend inversion ; 1 = strong buy / strong sell only
    // --- end of settings
    
    source = customclose
    
    // Calculations
    if useemasmoother then
    src = average[srcemaperiod,1](source)
    else
    src=source
    endif
    
    hh = highest[p](src) // Highest of src p-bars back;
    ll = lowest[p](src) // Lowest of src p-bars back.
    d = hh - ll
    
    if barindex>p then
    once m = (hh + ll) / 2 // Initial trend line;
    atr = AverageTrueRange[atrp][1] // ATR;
    epsilon = mult * atr // Epsilon is a mathematical variable used in many different theorems in order to simplify work with mathematical object. Here it used as sensitivity measure.
    
    if mode=2 then  //type B
    changeup = src crosses over m+epsilon or src crosses under m+epsilon
    changedown = src crosses over m-epsilon or src crosses under m-epsilon
    else
    changeup = src crosses over m+epsilon or src > m+epsilon
    changedown = src crosses under m-epsilon or src < m-epsilon
    endif
    
    sb = open < ll + d / 8 and open >= ll
    ss = open > hh - d / 8 and open <= hh
    strongbuy = sb or sb[1] or sb[2] or sb[3] or sb[4]
    strongsell = ss or ss[1] or ss[2] or ss[3] or ss[4]
    
    if (changeup or changedown) then
    if changeup then
    m=m + epsilon
    elsif changedown then
    m=m - epsilon
    endif
    else
    m=m[1]
    endif
    
    if changeup then
    r=0
    g=255
    elsif changedown then
    r=255
    g=0
    endif
    
    if signalsview=1 then
    if strongbuy and ls<>1 then
    buy 1 share at market
    ls=1
    endif
    if strongsell and ls<>-1 then
    sellshort 1 share at market
    ls=-1
    endif
    else
    if r<>r[1]and r>0 then
    sellshort 1 share at market
    endif
    if r<>r[1]and r=0 then
    buy 1 share at market
    endif
    endif
    endif
    set stop ploss 5
    set target pprofit 3
Viewing 6 posts - 1 through 6 (of 6 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

PRC Q trend


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Fahad @doo23559 Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Jean FXJean FX
2 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/24/2023
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...