stockdaddy
New member
Hello,
I don't know why this is so hard to find, I have searched many threads.
My code is simple, create and AddCloud() function that starts on a specific date & time with a high and low range.
I can get everything I need except for the cloud to start at a specific time.
Seems simple but just can't figure out the easiest way to achieve it?
Any help would be greatly appreciated.
Hopefully more adequate programmers than myself will be able to help me
I don't know why this is so hard to find, I have searched many threads.
My code is simple, create and AddCloud() function that starts on a specific date & time with a high and low range.
I can get everything I need except for the cloud to start at a specific time.
Seems simple but just can't figure out the easiest way to achieve it?
Any help would be greatly appreciated.
Code:
# Manual display of a single supply or demand cloud
#
input showCloud = yes;
input Startdate = 20221215;
input Starttime = 1030;
input Enddate = 20221231;
input recLow = 4000;
input recHigh = 4100;
input isSupply = {default "Yes", "No"};
def sDate = (GetYYYYMMDD() >= Startdate);
def sTime = (Gettime() >= Starttime);
def rLow = recLow;
def rHigh = recHigh;
AddCloud(if (showcloud and sdate and sTime and isSupply) then rHigh else Double.NaN, rLow, color.GREEN);
AddCloud(if (showcloud and sdate and sTime and isSupply is false) then rHigh else Double.NaN, rLow, color.RED);
Hopefully more adequate programmers than myself will be able to help me