trend

How to access the last indicator values

老子叫甜甜 提交于 2021-01-29 10:01:15
问题 I've got an indicator which shows pivot points: //@version=4 study("Trend", overlay=false) leftBars = input(3) rightBars = input(3) ph = pivothigh(high, leftBars, rightBars) pl = pivotlow(low, leftBars, rightBars) How can I check if the last ph was higher than the ph before? (I'd like to check for an uptrend or downtrend) 回答1: You can try the following code (including your original, as you see): //@version=4 study("Trend", overlay=false) leftBars = input(3) rightBars = input(3) ph = pivothigh

How can I get my points to connect in a plot and show a trend with NA values in data?

懵懂的女人 提交于 2020-01-30 10:35:33
问题 I have a basic set of data, where I measure concentration over time for 24 months. Some months have not been sampled, so there are 6 NA values in my list. The na.omit() function removes my NA values and gives me the graph I am looking for, but it ruins my axis. (1) plot(time, pt, type="o", pch=16, col="blue", xlab="Time (months) relative to implant", ylab="Concentration (ng/ml)", main="Concentration Overtime", xaxt='n') axis(1, at=seq(-1, 24, by=1)) (2) plot(na.omit(pt), type="o", pch=16, col

How to calculate and plot multiple linear trends for a time series?

牧云@^-^@ 提交于 2020-01-23 03:52:06
问题 Fitting a linear trend to a set of data is straight forward. But how can I fit multiple trend lines to one time series? I define up and down trends as prices above or below a exponential moving average. When the price is above the EMA I need to fit a positive trend and when the trend turns negative a new negative trend line and so forth. In my code below the market_data['Signal'] in my pandas dataframe tells me if the trend is up +1 or down -1. I'm guessing I need some kind of a loop, but I

How do I recreate an Excel formula which calls TREND() in C#?

会有一股神秘感。 提交于 2020-01-12 08:27:14
问题 I'm building a .net page to mimic a spreadsheet. The sheet contains this formula =ROUND(TREND(AA7:AE7,AA$4:AE$4,AF$4),1) Can someone provide the C# equivalent of TREND() ? Alternatively if anyone can provide a shortcut around it that's fine too; I'm not familiar enough with the math there to know if there's an easier way. Here are some sample numbers if it helps. AA7:AE7 6 8 10 12 14 or 10.2 13.6 17.5 20.4 23.8 AA$4:AE$4 600 800 1000 1200 1400 AF$4 650 edit: here's what I came up with and it

How do I recreate an Excel formula which calls TREND() in C#?

丶灬走出姿态 提交于 2020-01-12 08:27:08
问题 I'm building a .net page to mimic a spreadsheet. The sheet contains this formula =ROUND(TREND(AA7:AE7,AA$4:AE$4,AF$4),1) Can someone provide the C# equivalent of TREND() ? Alternatively if anyone can provide a shortcut around it that's fine too; I'm not familiar enough with the math there to know if there's an easier way. Here are some sample numbers if it helps. AA7:AE7 6 8 10 12 14 or 10.2 13.6 17.5 20.4 23.8 AA$4:AE$4 600 800 1000 1200 1400 AF$4 650 edit: here's what I came up with and it

Jenkins—get “Build Time Trend” values using “Remote Access API”

混江龙づ霸主 提交于 2019-12-30 01:53:36
问题 Is there a way that we can get all Jenkins-"Build Time Trend" information ( Build number + Status[success/failed etc] + Duration ) for an application; using the Jenkins remote access API? Or else I would appreciate if you could post a link of any documentation on how to get information from Jenkins using the Remote Access API. Most of the sources consist of the way of running jobs, but I couldn't find any, which shows how to fetch information from jenkins. Thanks! 回答1: You can use something

How to calculate the steepness of a trend in python

佐手、 提交于 2019-12-24 06:49:57
问题 I am using the regression slope as follows to calculate the steepness (slope) of the trend. Scenario 1: For example, consider I am using sales figures (x-axis: 1, 4, 6, 8, 10, 15 ) for 6 days (y-axis). from sklearn.linear_model import LinearRegression regressor = LinearRegression() X = [[1], [4], [6], [8], [10], [15]] y = [1, 2, 3, 4, 5, 6] regressor.fit(X, y) print(regressor.coef_) This gives me 0.37709497 Scenario 2: When I run the same program for a different sale figure (e.g., 1, 2, 3, 4,

error in stl .series is not periodic

落花浮王杯 提交于 2019-12-21 21:28:13
问题 I am pretty sure I am missing something which is very simple but still not able to figure out why this error is showing up . The data I have is of every month end data from 2013 Apr to 2014 Mar. Now I want to understand the trend over the 12 months period . xx <- structure(c(41.52, 41.52, 41.52, 41.68, 41.68, 41.68, 41.84, 41.84, 41.84, 42.05, 42.05, 42.05), .Tsp = c(2013.25, 2014.16666666667, 12), class = "ts"); is my time series data . Now when I use stl(xx,s.window ="periodic") I get error

Excel OFFSET function error when using TREND in reference

匆匆过客 提交于 2019-12-13 03:36:04
问题 Consider an Excel sheet with the following values: A B -------- 1| 1 5 2| 2 8 3| 3 11 Entering the array formula =TREND(B1:B3,A1:A3,A1:A3) in cells C1:C3 returns {5;8;11} , as expected. Entering =OFFSET(C1:C3,1,0) returns {8;11;0} , also as expected. However, if I try entering =ROWS(OFFSET(TREND(B1:B3,A1:A3,A1:A3),1,0)) , I get the message, "The formula you typed contains an error". I can't do anything to get it to accept the formula. Next I created the named ranges "TrendRange" and

How to determine trend of time-series of values in R

天大地大妈咪最大 提交于 2019-12-11 13:07:19
问题 I am looking for help writing a function that can identify a trend ("positive/negative/mixed", see definition below) in a value for a given customer in a dataset. I have the following transactional data; all customers have between 3-13 transactions each. customer_ID transaction_num sales Josh 1 $35 Josh 2 $50 Josh 3 $65 Ray 1 $65 Ray 2 $52 Ray 3 $49 Ray 4 $15 Eric 1 $10 Eric 2 $13 Eric 3 $9 I would like to write a function in R that populates a new dataframe as follows Customer_ID Sales_Slope