How Do i Draw ellipse

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #39774 quote
    CHIFHE
    Participant
    Junior

    Can any one write a simple code to draw eclipse on the price once close.

    #39782 quote
    Nicolas
    Keymaster
    Master

    You meant “ellipse”? 😆

    To draw a circle (an ellipse), you need 2 set of coordinates, just like you would draw a rectangle for instance: DRAWELLIPSE

    What do you want to have inside the ellipse please?

    #39796 quote
    CHIFHE
    Participant
    Junior

    Yes, Ellipse, inside ellipse there must be Candle for that a period. like for example instead of putting buy signal then there must be ellipse. I have attached example with buy or sell signal. instead of those buy and sell signal I need to replace it with ellipse to show me that my startergy is activated once the candle closes then the trade will be placed.

    #39798 quote
    Nicolas
    Keymaster
    Master

    I copy/paste your document here:

    Description

    Long signal (buy)

    When cycle cross over value 0 then buy signal activated. When CCI cross over 100 then is over bought exit the trade.

    Short Signal (Sell)

    When cycle cross under value 0 then sell signal activated and when CCI cross under -100 is oversold exit the trade.

     

    // Conditions to enter long positions
    
    indicator1 = Cycle(close)
    
    c1 = (indicator1 CROSSES OVER 0)
    
    
    
    IF c1 THEN
    
    DRAWARROWUP(barindex, low*0.999) coloured (0,255,255)
    
    DRAWTEXT("BUY", barindex, LOW*0.992,SansSerif,Bold,12)coloured(0,255,255)
    
    ENDIF
    
    
    
    // Conditions to exit long positions
    
    indicator2 = CCI[20]
    
    c2 = (indicator2 CROSSES OVER 100)
    
    
    
    IF c2 THEN
    
    
    
    ENDIF
    
    
    
    // Conditions to enter short positions
    
    indicator3 = Cycle(close)
    
    c3 = (indicator3 CROSSES UNDER 0)
    
    
    
    IF c3 THEN
    
    DRAWARROWDOWN(barindex, HIGH*1.001) coloured (128,0,128)
    
    DRAWTEXT("SELL", barindex, HIGH*1.008,SansSerif,Bold,12)coloured(128,0,128)
    
    
    
    
    
    
    
    ENDIF
    
    
    
    // Conditions to exit short positions
    
    indicator4 = CCI[20]
    
    c4 = (indicator4 CROSSES UNDER -100)
    
    
    
    IF c4 THEN
    
    
    
    ENDIF
    
    
    
    //Inside Bar Breakout Failure indicator
    
    
    
    
    
    
    
    bullcandle=open<close
    
    bearcandle=open>close
    
    
    
    
    
    
    
    insidebarbear= bearcandle and high[0]<high[1] and low[0]>low[1]
    
    if insidebarbear then
    
    DRAWTEXT("↓", barindex, high[1], Dialog, ITALIC,10) COLOURED(147,112,219)
    
    //DRAWARROWDOWN(barindex,high[1]) COLOURED(0,0,0)
    
    DRAWCANDLE(open,high,low,close) COLOURED(0,0,0) BORDERCOLOR(255,0,0)
    
    endif
    
    insidebarbull= bullcandle and high[0]<high[1] and low[0]>low[1]
    
    if insidebarbull then
    
    DRAWTEXT("↑", barindex, high[1], Dialog,ITALIC, 10) COLOURED(147,112,219)
    
    //DRAWARROWDOWN(barindex,high[1]) COLOURED(0,0,0)
    
    DRAWCANDLE(open,high,low,close) COLOURED(0,0,0) BORDERCOLOR(0,255,0)
    
    endif
    
    
    
    
    
    
    
    insidebarFailureBull=bullcandle and (low[1]<Low[0] or high[1]>high[0]) and(insidebarbull[1] and close[0]<close[1] and close[0]>open[1]) or insidebarbear[1] and close[0]<open[1] and close[0]>close[1] //
    
    
    
    if insidebarFailureBull and not (insidebarbear or insidebarbull) then
    
    DRAWTEXT("¬", barindex, high[1], Dialog,ITALIC, 10) COLOURED(147,112,219)
    
    DRAWCANDLE(open,high,low,close) COLOURED(255,255,255) BORDERCOLOR(0,255,0)
    
    //DRAWARROWUP(barindex,low[0]) COLOURED(0,255,0)
    
    endif
    
    //================
    
    
    
    insidebarFailureBear=bearcandle and (low[1]<Low[0] or high[1]>high[0]) and(insidebarbear[1] and close[0]>close[1] and close[0]<open[1]) or insidebarbull[1] and close[0]>open[1] and close[0]<close[1]
    
    
    
    
    
    if insidebarFailureBear and not (insidebarbear or insidebarbull) then
    
    DRAWTEXT("∟", barindex, high[1], Dialog,ITALIC, 10) COLOURED(147,112,219)
    
    DRAWCANDLE(open,high,low,close) COLOURED(255,255,255) BORDERCOLOR(255,0,0)
    
    //DRAWARROWUP(barindex,low[0]) COLOURED(255,0,0)
    
    endif
    
    
    
    RETURN

    I attached the example of what the code is doing right now, could you please tell me what signals should be replace by an ellipse now? There are many different things already plotted, that’s why I asked to be sure 🙂 Thanks.

    #39840 quote
    CHIFHE
    Participant
    Junior

    Buy signal and sell signal to be replaced by ellipse.

    Thanks in advance Nico

    #39844 quote
    Nicolas
    Keymaster
    Master

    Ok, so I replaced the “buy” and “sell” text with ellipse including the candlesticks that generate the signals. They are drawn 1 bar after the signal, because to include correctly the candlestick into the circle, we need to start to draw it before the bar and end after it.

    // Conditions to enter long positions
    
    indicator1 = Cycle(close)
    
    c1 = (indicator1 CROSSES OVER 0)
    
    
    
    IF c1 THEN
    DRAWARROWUP(barindex, low*0.999) coloured (0,255,255)
    //DRAWTEXT("BUY", barindex, LOW*0.992,SansSerif,Bold,12)coloured(0,255,255)
    ENDIF
    if c1[1] then 
    DRAWELLIPSE(barindex[2], low[1], barindex, high[1])coloured(0,255,255)
    endif
    
    
    
    // Conditions to exit long positions
    
    indicator2 = CCI[20]
    
    c2 = (indicator2 CROSSES OVER 100)
    
    
    
    IF c2 THEN
    
    
    
    ENDIF
    
    
    
    // Conditions to enter short positions
    
    indicator3 = Cycle(close)
    
    c3 = (indicator3 CROSSES UNDER 0)
    
    
    
    IF c3 THEN
    
    DRAWARROWDOWN(barindex, HIGH*1.001) coloured (128,0,128)
    
    //DRAWTEXT("SELL", barindex, HIGH*1.008,SansSerif,Bold,12)coloured(128,0,128)
    ENDIF
    if c3[1] then
    DRAWELLIPSE(barindex[2], low[1], barindex, high[1])coloured(128,0,128)
    endif
    
    
    // Conditions to exit short positions
    
    indicator4 = CCI[20]
    
    c4 = (indicator4 CROSSES UNDER -100)
    
    
    
    IF c4 THEN
    
    
    
    ENDIF
    
    
    
    //Inside Bar Breakout Failure indicator
    
    
    
    
    
    
    
    bullcandle=open<close
    
    bearcandle=open>close
    
    
    
    
    
    
    
    insidebarbear= bearcandle and high[0]<high[1] and low[0]>low[1]
    
    if insidebarbear then
    
    DRAWTEXT("↓", barindex, high[1], Dialog, ITALIC,10) COLOURED(147,112,219)
    
    //DRAWARROWDOWN(barindex,high[1]) COLOURED(0,0,0)
    
    DRAWCANDLE(open,high,low,close) COLOURED(0,0,0) BORDERCOLOR(255,0,0)
    
    endif
    
    insidebarbull= bullcandle and high[0]<high[1] and low[0]>low[1]
    
    if insidebarbull then
    
    DRAWTEXT("↑", barindex, high[1], Dialog,ITALIC, 10) COLOURED(147,112,219)
    
    //DRAWARROWDOWN(barindex,high[1]) COLOURED(0,0,0)
    
    DRAWCANDLE(open,high,low,close) COLOURED(0,0,0) BORDERCOLOR(0,255,0)
    
    endif
    
    
    
    
    
    
    
    insidebarFailureBull=bullcandle and (low[1]<Low[0] or high[1]>high[0]) and(insidebarbull[1] and close[0]<close[1] and close[0]>open[1]) or insidebarbear[1] and close[0]<open[1] and close[0]>close[1] //
    
    
    
    if insidebarFailureBull and not (insidebarbear or insidebarbull) then
    
    DRAWTEXT("¬", barindex, high[1], Dialog,ITALIC, 10) COLOURED(147,112,219)
    
    DRAWCANDLE(open,high,low,close) COLOURED(255,255,255) BORDERCOLOR(0,255,0)
    
    //DRAWARROWUP(barindex,low[0]) COLOURED(0,255,0)
    
    endif
    
    //================
    
    
    
    insidebarFailureBear=bearcandle and (low[1]<Low[0] or high[1]>high[0]) and(insidebarbear[1] and close[0]>close[1] and close[0]<open[1]) or insidebarbull[1] and close[0]>open[1] and close[0]<close[1]
    
    
    
    
    
    if insidebarFailureBear and not (insidebarbear or insidebarbull) then
    
    DRAWTEXT("∟", barindex, high[1], Dialog,ITALIC, 10) COLOURED(147,112,219)
    
    DRAWCANDLE(open,high,low,close) COLOURED(255,255,255) BORDERCOLOR(255,0,0)
    
    //DRAWARROWUP(barindex,low[0]) COLOURED(255,0,0)
    
    endif
    
    
    
    RETURN
    
    #39870 quote
    CHIFHE
    Participant
    Junior

    You are amazing, Thank you very much Nico. It work perfectly

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

How Do i Draw ellipse


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
CHIFHE @tshivhmc1 Participant
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by CHIFHE
8 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/04/2017
Status: Active
Attachments: 3 files
Logo Logo
Loading...