Highest of morning first candle [closed] - algorithmic-trading

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I want to get high of the first morning candle. highest(series, length) returns highest of last (length) numbers of candle. How can I get high of the first morning candle?

That could be achieved like that:
//#version=4
study("My Script", overlay=true)
dayStart = time('D')
dayStartHigh = 0.0
dayStartHigh := dayStartHigh[1]
// make sure it's a new day
if (dayStart[1] != dayStart)
dayStartHigh := high
plot(dayStartHigh)

Related

Calculate % of number in Scala programming [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 11 months ago.
Improve this question
How to do 50% of 120 in scala code..need proper syntax ,& runnable code for same.
Eg :
int k = (int)(120*(50.0f/100.0f));
This is in java need scala code for same.
The answer would be:
(120*(50.0f/100.0f)).toInt

Get round number from rand [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
How I can get always round number from Ruby rand method between the interval rand(1..99999999).
For Example I want to get as a result for example 1000 or 100000
Randomize the power of 10:
10 ** rand(1..9)
Why not this:
('1' + '0' * (0..10).sample).to_i

What are the best uses for Go Imaginary Literals? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last month.
Improve this question
It would be fine for me if the code below returned true.
Since it has not, what are the best uses for this feature? What am I missing?
a := 10.52i
b := 10i
fmt.Println(a == b)
//false
Based on #Tashi, #Arkku and #axiac's comments, I realized that I am missing Math knowledge to understand this feature.

TextFields devision and showing in label [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
There are two textfields, i need that would introduced number in first textfield divided by introduced number in second textfield and showed result in separate label. Help please!
If I understand your question correctly, the following should work:
label3.text = String(Float(label1.text) / Float(label2.text))
You take the text in label1, convert it to a float, do the same for label2, do the conversion and then convert it back to a string. Then take that string and set it as the text of label3.
(Note: The reason I chose to cast to Float and not to Int is because you will lose any remainder from the division. If there is no chance of a remainder, or if it is not important, then I would suggest using Int)

How to use an upto method in ruby to count up by 100? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I need to make a program that counts down from 10, displays a message, and then immediately after starts counting from 100 metres to 200 metres, and so on up to 100,000 metres. I can't figure out how to do the last part. This is the code I have so far.
10.downto(1) do|counter|
puts counter
sleep 1
end
puts "Blast off!"
If you mean in increments of 100, try this:
100.step(100_000, 100) {|c| puts c; sleep(0.5)}

Resources