AlgebraLib
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © M_0_2_8

//@version=5

// @description: Algebra Library with useful and recurring functions
library("AlgebraLib", overlay=true)

// @function: Draw a simple label with Buy or Sell signal
// @param side: STRING, Signal Side (ex: "BUY" or "SELLa progressive number)
// @param date: INT, Signal date/time (ex:  timestamp("Europe/Amsterdam",2023, 05, 29, 16, 0, 0))
// @returns: VOID, it draws a new label 
export signaldraw(string _side, int _date) =>
    if barstate.islast
        if _side == "BUY"
            label.new(_date, low , _side, xloc.bar_time, yloc.belowbar, color=color.green, textcolor=color.white, style=label.style_label_up)
        else
            label.new(_date, high , _side, xloc.bar_time, yloc.abovebar, color=color.red, textcolor=color.white, style=label.style_label_down)
