Nelane |
Gold User, Member, Platinum User, TeleChart
|
Registered User |
|
|
|
|
Unsure |
|
Thursday, October 7, 2004 |
Friday, September 6, 2019 3:52:56 PM |
56 [0.02% of all post / 0.01 posts per day] |
|
Try Output Constant Single.
|
AAhh! Of course.
Thank you, Bruce.
|
I thought there was only a syntax error in that code. This explanation would have never occured to me. You probably explain things better because you're not a programmer.
I looked up in RealCode API the difference between MovingAverage and AVG methods however I noticed that neither MovingAverage(period, barStyle) nor AVG(period, barStyle) work when I copy-paste into editor the examples given:
Plot = price.MovingAverage(30,RealCodeIndicator.BarValue.High).XAVG(5)
plot = price.AVG(30,RealCodeIndicator.BarValue.Low).Value
AVGH, AVGL, AVGO cannot be used to chain more functions with, so how to use average of High or Low with other functions?
|
'# period = userinput.integer = 10
Dim MinL As Single
MinL = Price.MinLow(Period)
plot = MinL.AVG(Period)
|
How can I make MarketDataReader (code below) to not display zero on the chart when there is no data or the data is 0 for a particular date/time.
I tried to refer to data reader from another indicator:
If MarketDataReader.value <> 0 then plot = MarketDataReader .value
but it didn't work.
And also, how to make MarketDataReader display OHLC data?
Sub New
autoloop = False
End Sub
Public Overrides function Plot() as System.Single
Dim reader As New MarketDataReader("mydata.txt")
reader.dateindex = 0
reader.valueindex = 1
reader.delimiter = ","
reader.outputfile(Me)
|
How can I make MarketDataReader (code below) to not display zero on the chart when there is no data or the data is 0 for a particular date/time.
I tried to refer to data reader from another indicator:
If MarketDataReader.value <> 0 then plot = MarketDataReader .value
but it didn't work.
And also, how to make it display OHLC data?
Sub New
autoloop = False
End Sub
Public Overrides function Plot() as System.Single
Dim reader As New MarketDataReader("mydata.txt")
reader.dateindex = 0
reader.valueindex = 1
reader.delimiter = ","
reader.outputfile(Me)
|
I have a userinput in my realcode indicator and in block diagram I reconnected the parameter: decimal number with a numeric selector. But this connection tends to revert itself every time I change time frame, open and close the realcode editor, etc.
Is there a way to refer to a numeric selector directly from the real code indicator?
|
Bruce, could you please comment on the code? It works perfectly, I'd just like to understand how and why.
I add my questions to the code:
Sub New
AutoLoop = False
'# Percent = UserInput.Single = 0
End Sub
Public Overrides Function Plot() As System.Single
Dim Start As Integer = Price.Bar.Count - 1
Dim Close As Single = Price.Bar.Value(Start)
While Price.Bar.DateValue(Start).DayOfYear = Price.Bar.DateValue(Start - 1).DayOfYear
Start -= 1 what does the "-" singn before the "=" sign mean? And what doeas this line do?
Close = Price.Bar.Value(Start - 1)
End While
For i As Integer = Start To Price.Bar.Count - 1 Can this be written as "... Start to Start - 1"? If yes then why it isn't written that way?
AddToOutput(Price.Bar.DateValue(i), Close * (1 + Percent / 100)) Close has been defined earlier in the code as: Dim Close As Single = Price.Bar.Value(Start) and then as: Close = Price.Bar.Value(Start - 1) Which Close is being used in this line?
Next
End Function
End Class
|
How do I go about creating a horizontal line that begins at today's time of open (i.e. the line does not go accross the whole pane), extending to the right end of my intraday chart
and
the value would be determined as a certain userinputted % away from yesterday's close.
|
I am trying to make a plot that would graphically display the trades I made.
Is there a way to have the data fit neatly even as I change time frames?
Say, I would have the times of trades rounded to 5 minutes (11:32:16 AM would be rounded to 11:35:00 AM) to fit a 5min time frame. But if I have another trade at 11:52 and I view it in 30min or daily timeframe, then that will add a space pushing apart the bars on the price chart.
In other words, is there a way to write data and have it called like StockFinder calls the Price and Volume data that are part of Stock Finder? Where do I find these data and how do I view them?
|
|