Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Profile: sageofhalo
About
User Name: sageofhalo
Groups: Member, Platinum User, TeleChart
Rank: Registered User
Real Name:
Location
Occupation:
Interests:
Gender: Unsure
Statistics
Joined: Sunday, February 24, 2013
Last Visit: Monday, June 17, 2019 12:24:03 PM
Number of Posts: 16
[0.01% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Linear Regression
Posted: Friday, October 26, 2018 10:31:36 AM

End result was that the linear regression was rounding to the hundredths place (0.00) in the calculations concerning the condition.  The solution was to open the block diagram from the edit menu of the condition and insert a "Multiply by Value" block and set it to a big enough number to bring the value of the LR into a range where rounding didn't cause issues.  In my case I had to use 1000-10000 for the two LRs in my condition.

 

Topic: Linear Regression
Posted: Wednesday, October 24, 2018 11:13:06 AM

Will do.

Topic: Linear Regression
Posted: Wednesday, October 24, 2018 10:24:53 AM

The period is 14.  Its odd it just shows up sporadically.  Always correct but is missing lots of bars that should be correct too.

 

Topic: Linear Regression
Posted: Wednesday, October 24, 2018 1:22:23 AM

Ok new problem. >.<

My condition doesn&#39;t seem to refer to historical data correctly.

For example:

&#39;# LRS = chart.LinearRegressionSlope.3

If LRS.value(0) > LRS.value(1) Then
Pass
End If
 
 
This code causes the condition to return true somewhat randomly.  It never shows pass when it shouldn&#39;t but it is missing a lot of bars where it should show pass.
 
The actual condition I&#39;m writing is more complex but this is the first issue I&#39;m up against in getting it to work.
 
Can you call historical data from an imported indicator?  Is my syntax wrong?
 
Thank you,
Connor
Topic: Linear Regression
Posted: Tuesday, October 23, 2018 3:59:35 PM

Oh I did not know that was possible. Thank you... that opens a lot of doors for me.

Honestly thank you so much!

Topic: Linear Regression
Posted: Tuesday, October 23, 2018 3:39:00 PM

Hello,

I want to call the value of a linear regression slope of indicator that is a child of a 200 exponential moving average of price.  Is there any way to call this value in Real Code.  I can&#39;t seem to figure out how to call it and the math would be quite complex to do manually best as I can figure.

Thank you,

Connor

Topic: Storing a value in a variable for future bars to reference
Posted: Tuesday, October 2, 2018 4:13:48 PM

Hello,

I have another issue I&#39;m trying to fix and searching hasn&#39;t turned up a solution.  I am telling a variable to be defined as price.Close(X) where X is user defined.  But really what I want is for that variable to store the value of price.Close(X) for future bars to compare against until the variable is redefined as a new value.  Is there a way to do this?

Thresh and Hold are the variables that are not sticking to the value for the bar in which they are defined.  Clearly I&#39;m doing it wrong and need the proper coding to do what I&#39;m after.  As an aside the code might have some redundant elements like Exit Function and Plots as I&#39;ve been troubleshooting but this is where it&#39;s at right now. Also Starting Trend as "Down" is sort of a workaround at the moment.

Thank you in advance,

Connor

Here is the code:

&#39;# Smoothing = UserInput.Integer = 5
 
Dim Ind As Single
Dim Check As Boolean = False
Dim Thresh As Single
Dim Hold As Single
Dim Trend As String = "Down"
 
 
 
Select Case Trend
Case = "Up"
Select Case price.Close
Case > price.Close(1) And Check = False
Thresh = price.Close(Smoothing)
Ind = price.Close
Plot = Ind
Exit Function
Case > price.Close(1) And Check = True And price.Close <= Hold
Ind = Hold
Plot = Ind
Exit Function
Case > price.Close(1) And Check = True And price.Close > Hold
Check = False
Thresh = price.Close(Smoothing)
Ind = price.Close
Plot = Ind
Exit Function
Case <= price.Close(1) And Check = False And price.Close > price.Close(Smoothing)
Hold = price.Close(1)
Thresh = price.Close(Smoothing)
Check = True
Ind = price.Close(1)
Plot = Ind
Exit Function
Case <= price.Close(1) And Check = True And price.Close > Thresh
Ind = Hold
Plot = Ind
Exit Function
Case <= Thresh
Trend = "Down"
Check = False
Thresh = price.Close(Smoothing)
Ind = price.Close
Plot = Ind
Exit Function
End Select
Case = "Down"
Select Case price.Close
Case < price.Close(1) And Check = False
Thresh = price.Close(Smoothing)
Ind = price.Close
Plot = Ind
Exit Function
Case < price.Close(1) And Check = True And price.Close >= Hold
Ind = Hold
Plot = Ind
Exit Function
Case < price.Close(1) And Check = True And price.Close < Hold
Check = False
Thresh = price.Close(Smoothing)
Ind = price.Close
Plot = Ind
Exit Function
Case >= price.Close(1) And Check = False And price.Close < price.Close(Smoothing)
Hold = price.Close(1)
Thresh = price.Close(Smoothing)
Check = True
Ind = price.Close(1)
Plot = Ind
Exit Function
Case >= price.Close(1) And Check = True And price.Close < Thresh
Ind = Hold
Plot = Ind
Exit Function
Case >= Thresh
Trend = "Up"
Check = False
Thresh = price.Close(Smoothing)
Ind = price.Close
Plot = Ind
Exit Function
End Select
End Select

 

Topic: RC Indicator Returns 0.00
Posted: Friday, September 28, 2018 12:37:02 AM

The solution was that there was an undeclared number for "period" in the block diagram.  They worked with me to fix it and get it defined.

 

Thanks

Topic: RC Indicator Returns 0.00
Posted: Thursday, September 27, 2018 2:32:47 PM

Hello,

 

Having trouble with the following:

 

&#39;# ATR = indicator.Library.Average True Range
 
 
Dim Trend1 As Single
Dim Trend2 As Single
Dim Trend3 As Single
 
Trend1 = Price.Close - Price.XAVG(20)
Trend2 = Price.Close - Price.XAVG(50)
Trend3 = Price.Close - Price.XAVG(200)
 
Plot = (Trend1 + Trend2 + Trend3) / ATR.AVG(200)
 
Without the "/ATR.AVG(200)" portion it functions properly.  With that portion it returns all 0.  Any ideas as to what is going on?
 
Thank you,
Connor
Topic: Identifier Expected when I import an indicator
Posted: Tuesday, June 7, 2016 3:36:50 PM

Solved

 

I was running the above code along with some simlar code to generate an indicator that would range in values of 3, 1, -1, and 0.  Basically Elder Impulse with 3C added in as a third qualifier.  The problem was that if I coded both components of Elder Impulse and the component of 3C it would stack overflow and crash.

The solution was to just code the EI components and 3C component separately and then drag them together to do a Plot Comparison and select Add.

The end result is what I was after and doesn&#39;t seem to crash the program yet.

 

Sorry for a now useless post but maybe people can learn from my amateur fumbling around.

 

Thanks again.