Category Oscilators  Published on 27/03/2024

Temporal Divergence Indicator by eMeSeM

Description

The Temporal Divergence Indicator is an analytical tool used in trading to identify discrepancies between price behavior in different time intervals. These divergences can provide valuable signals for making trading decisions, such as entry or exit points from the market.

The price for this indicator is 14€
Contact us at info@emesem.it

Contact us at 

Here’s how it works:

Definition of Temporal Divergences:

  • The indicator compares two time series of prices: one in the short term (e.g., 1 hour) and the other in the long term (e.g., 1 day).
  • Divergence occurs when the two price series move in opposite directions. For example, if the short-term price is rising while the long-term price is falling, a divergence occurs.

Types of Temporal Divergences:

  • Bullish Divergence: Occurs when the short-term price is decreasing while the long-term price is increasing. This could indicate a potential buying opportunity in the short term to follow the direction of the overall trend.
  • Bearish Divergence: Occurs when the short-term price is increasing while the long-term price is decreasing. This could indicate a potential selling opportunity in the short term to follow the direction of the overall trend.

Using Temporal Divergences:

  • Traders use these divergences to make trading decisions:
    • Entry: If a bullish divergence occurs, it might be a signal to buy.
    • Exit: If a bearish divergence occurs, it might be a signal to sell.

Indicator Calculation:

  • The temporal divergence indicator in our case uses two MACDs set on different timeframes.

Considerations:

  • Temporal divergences are not always accurate, so it’s essential to confirm signals with other information.
  • Customize the indicator based on your trading style and objectives.

Remember that technical analysis is subject to interpretation and market risks. Study indicators carefully and test them on historical data before using them in real trading. Happy trading!


The author decided to hide the source code.
MI
mirco.saccomani

Joined on 23.03.2024

  • Distribution: Paid
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: TemporalDivergenceIndicator_eMeSeM.algo
  • Rating: 5
  • Installs: 0
Comments
Log in to add a comment.
AL
alirezayousefi1011 · 3 months ago

Convert this code


//@version=4

study(title          = "BULB indicator",

     shorttitle      = "BULB indicator",

     overlay         = true,

     precision       = 4,

     linktoseries    = false,

     max_bars_back   = 1000,

     max_lines_count = 500)



 

recommendation = input(true, title = "BULB")




 

rsiSource = close

rsiLength = 13

rsiOverbought = 70

rsiOvesold = 30



 

rsiValue = rsi(rsiSource, rsiLength)



 

isOverbought = rsiValue >= rsiOverbought

isOversold = rsiValue <= rsiOvesold



 

var laststate = 0



 

var hh = low

var ll = high



 

var label labelll = na

var label labelhh = na



 

var line line_up = na

var line line_down = na


 

var last_actual_label_hh_price = 0.0

var last_actual_label_ll_price = 0.0







 

obLabelText() =>

    if(last_actual_label_hh_price < high)

        "sell"

    else

        "sell"


 

osLabelText() =>

    if(last_actual_label_ll_price < low)

        "buy"

    else

        "buy"



 

createOverBoughtLabel(isIt) =>

    if(isIt)

        label.new(x=bar_index, y=na ,yloc=yloc.price, style=label.style_label_down, color=#F70700, size=size.normal, text=obLabelText(), textcolor = color.white)

    else

        label.new(x=bar_index, y=na ,yloc=yloc.price, style=label.style_label_up, color=#22E139, size=size.normal, text=osLabelText(), textcolor = color.white)

       

       


 

moveOversoldLabel() =>

    label.set_x(labelll, bar_index)

    label.set_y(labelll, low)

    label.set_text(labelll, osLabelText())

    line.set_x1(line_down, bar_index)

    line.set_y1(line_down, low)

   

moveOverBoughtLabel() =>

    label.set_x(labelhh, bar_index)

    label.set_y(labelhh, high)

    label.set_text(labelhh, obLabelText())

    line.set_x1(line_up, bar_index)

    line.set_y1(line_up, high)



 

if(laststate == 2 and isOverbought and recommendation)

    hh := high

    labelhh := createOverBoughtLabel(true)

    last_actual_label_ll_price := label.get_y(labelll)

    labelll_ts = label.get_x(labelll)

    labelll_price = label.get_y(labelll)

    line_up := line.new(x1=bar_index, y1=high, x2=labelll_ts, y2=labelll_price, width=1)



 

if(laststate == 1 and isOversold and recommendation)

    ll := low

    labelll := createOverBoughtLabel(false)

    last_actual_label_hh_price := label.get_y(labelhh)

    labelhh_ts = label.get_x(labelhh)

    labelhh_price = label.get_y(labelhh)

    line_down := line.new(x1=bar_index, y1=high, x2=labelhh_ts, y2=labelhh_price, width=1)




 

if(isOverbought and recommendation)

    if(high >= hh)

        hh := high

        moveOverBoughtLabel()

    laststate := 1

   


 

if(isOversold and recommendation)

    if(low <= ll)

        ll := low

        moveOversoldLabel()

    laststate := 2

   

   


 

if(laststate == 1 and isOverbought and recommendation)

    if(hh <= high)

        hh := high

        moveOverBoughtLabel()

   


 

if(laststate == 2 and isOversold and recommendation)

    if(low <= ll)

        ll := low

        moveOversoldLabel()




 

if(laststate == 1 and recommendation)

    if(hh <= high)

        hh := high

        moveOverBoughtLabel()

       


 

if(laststate == 2 and recommendation)

    if(ll >= low)

        ll := low

        moveOversoldLabel()