Zero line question????

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #138201 quote
    Pleidian
    Participant
    Average

    Hi Nicholas, im trying to write code that involves an EMA break  above or below the Coppock “Zero line”. Im trying to delete “Buy” signals above the zero line and delete  “Sell” signals below the zero line. ONLY “SEL’L SIGNALS ABOVE THE ZERO LINE AND ONLY “BUY” SIGNAL BELOW THE ZERO LINE ! How do i write “Zero line” in code when there is no “Zero line” in the coding constraints?  Any suggestions?

    cheers

    Pleidian

    a = ROC[70](close)
    b = ROC[10](close)
    coppock = weightedaverage[50](a+b)
    
    avg = average[20,1](coppock)
    if avg crosses over coppock then
    DRAWTEXT("SELL", barindex, average[20,1](coppock), SansSerif, standard,15)coloured(0,0,0)
    endif
    
    if avg crosses under coppock then
    DRAWTEXT("BUY", barindex, average[20,1](coppock), SansSerif, standard,15)coloured(0,0,0)
    endif
    
    RETURN coppock as "Coppock curve", 0 as "0 level", avg as "average of coppock"
    GBPAUD-Daily.png GBPAUD-Daily.png
    #138205 quote
    Nicolas
    Keymaster
    Master

    Since the dawn of time, 0 is  just … 0! 😆

    coppock > 0

    (translation: coppock is above 0)

    poldoposta thanked this post
    #138370 quote
    Pleidian
    Participant
    Average

    ha ha ha…cheers

    poldoposta thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Zero line question????


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Pleidian @pleidian Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/03/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...