Percent change from previous bar


Category:
0
0

Hello Peter,

Is it possible to help me with a scan that scan 10% or more of increase or deacrease of the price within the last 10min? Regular price change calculated is from the open of the market to the curent time  but I want the price change from 5 min before the current time to the current time.

Marked as spam
Posted by (Questions: 16, Answers: 12)
Asked on June 24, 2020 8:48 pm
143 views
0
Private answer

I updated the title of your question because your request really has absolutely nothing to do with the time frame. The time frame is a setting, especially for scans because you can only use the time frame that is selected for your Study Filter. The code for a custom scan does not have anything to do with the time frame.

I want the price change from 5 min before the current time to the current time

So you apply a 5 min time frame to the Study Filter and you only need to write a statement that compares the price of the current bar to the price of the previous bar.

plot scan = close > close[1] * 1.1 or close < close[1] * 0.9;

This code checks for either of two conditions. Either the current price is greater than the previous close plus 10% or the current price is less than the previous close minus 10%.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on June 25, 2020 7:56 am