Draw a Segment between arrows

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #170264 quote
    Inertia
    Participant
    Master

    Hi all !

    I am confuse how to draw a coloured segment between the arrows…The code line iis at the bottom

    Thank you for your help 😉

     

    // The following code is related to this timescale:10 minutes
    MySMA20m = Average[20](close)
    MySMA10m = Average[10](close)
    
    c1 = (MySMA10m crosses over MySMA20m)
    
    c2 = (MySMA10m crosses under MySMA20m)
    
    Signalachat = c1
    Signalvente = c2
    
    If Signalachat then
    PrixACHAT = Low
    DRAWARROWUP(barindex,low-0)coloured(0,0,0)
    endif
    
    if Signalvente then
    PrixVENTE = high
    DRAWARROWDOWN(barindex,high+0) coloured(0,0,0)
    endif
    
    return PrixACHAT as "Signalachat", PrixVENTE as "Signalvente"
    
    //Hereafter is the code line to insert but How??
    //DRAWSEGMENT (barindex, close, barindex[5], close[5])
    #170271 quote
    Inertia
    Participant
    Master

    If I may add, I wish to have the segment also from the last “arrow” til the “currentbar”  that would be awesome !

    Big Thanks to the community 😉

    #170294 quote
    robertogozzi
    Moderator
    Master

    There you go:

    // The following code is related to this timescale:10 minutes
    MySMA20m = Average[20](close)
    MySMA10m = Average[10](close)
     
    c1 = (MySMA10m crosses over MySMA20m)
     
    c2 = (MySMA10m crosses under MySMA20m)
     
    Signalachat = c1
    Signalvente = c2
     
    If Signalachat then
       PrixACHAT = Low
       DRAWARROWUP(barindex,low-0)coloured(0,0,0)
       Bar1 = BarIndex
    endif
     
    if Signalvente then
       PrixVENTE = high
       DRAWARROWDOWN(barindex,high+0) coloured(0,0,0)
       Bar2 = BarIndex
    endif
    DRAWSEGMENT(Bar1,PrixACHAT,Bar2,PrixVENTE) coloured(0,255,0,255) STYLE(line,2)
    return PrixACHAT as "Signalachat", PrixVENTE as "Signalvente"
     
    //Hereafter is the code line to insert but How??
    //DRAWSEGMENT (barindex, close, barindex[5], close[5])
    Inertia thanked this post
    #170393 quote
    Inertia
    Participant
    Master

    You are exceptionnel Roberto !

    Grazie à Lei.

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

Draw a Segment between arrows


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Inertia @inertia Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Inertia
4 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/24/2021
Status: Active
Attachments: No files
Logo Logo
Loading...