DCA Bot Indicator
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TheSocialCryptoClub

//@version=5
indicator("DCA Bot Indicator", overlay=true)
hour_long = input.int(defval=2, minval=0, maxval=23, title="Buy on (after) hour: ", group="Buy Daily", tooltip="Use this and as the Script runs at the close of the bar of that time, if you would like to enter at 2, put here 1")
day_long_1 = input.int(defval=0, minval=0, maxval=31, title="Buy only on Day of Month: ",  group="Buy Monthly", tooltip="Use 0 to buy all days or specify a day of the month")

dow_filter_long_1 = input.bool(true, group="Buy Days of the Week", title="1. Sunday")
dow_filter_long_2 = input.bool(true, group="Buy Days of the Week", title="2. Monday")
dow_filter_long_3 = input.bool(true, group="Buy Days of the Week", title="3. Tuesday")
dow_filter_long_4 = input.bool(true, group="Buy Days of the Week", title="4. Wednesday")
dow_filter_long_5 = input.bool(true, group="Buy Days of the Week", title="5. Thursday")
dow_filter_long_6 = input.bool(true, group="Buy Days of the Week", title="6. Friday")
dow_filter_long_7 = input.bool(true, group="Buy Days of the Week", title="7. Saturday")
alert = input.string(defval="Hello from TheSocialCrypto!", title="Alert Message", tooltip="Use this to customize the message")

dow_filter_long_condition =  (dow_filter_long_1 and dayofweek == 1)  or (dow_filter_long_2 and dayofweek == 2)  or (dow_filter_long_3 and dayofweek == 3)  or (dow_filter_long_4 and dayofweek == 4)  or (dow_filter_long_5 and dayofweek == 5)  or (dow_filter_long_6 and dayofweek == 6)  or (dow_filter_long_7 and dayofweek == 7)
dom_filter_long_condition = (day_long_1 == 0) ? true : (day_long_1 == dayofmonth) ? true : false


color color_bg = na
if hour_long == hour and dow_filter_long_condition and dom_filter_long_condition
    alert(alert)
    color_bg := color.new(color.green, 25)

bgcolor(color_bg)