BreezeTrades808

Two MAs (nextSignals)

Hi folks, just some quick work inspired by ThinkScript code from @stephenharlinmd (the Doc).

This indicator seems to be intended for lower timeframes (3 min was used for example), and indicates long and short opportunities based on crossovers of the two lines.

The slow reference line is an EMA20. The fast line is referred to as an "Instantaneous Moving Average", which attempts to use OHLC4 values to create a realtime reference line for price instead of a lagging average. Its calculation is as follows:

1. The OHLC4 value is calculated by taking the average of the open, high, low, and close prices for each bar.

2. The ta.highest function is used to find the highest value of OHLC4 over the last 5 bars, and this value is stored in the ON variable.

3. The ta.lowest function is used to find the lowest value of ON over the last 5 bars, and this value is stored in the O1 variable.

4. The for loop is used to find the index of O1 in the P data series, which represents the OHLC4 values over the last 6 bars. If the value at the current index is equal to O1, and O1Loc has not already been set, then O1Loc is set to the current index.

5. The O2 variable is initialized to ON, and another for loop is used to find the index of the second lowest value of OHLC4 over the last 6 bars, which is not at the same index as O1. If the value at the current index is equal to O2, and O2Loc has not already been set, and the current index is not equal to O1Loc, then O2Loc is set to the current index.

6. The O3 variable is initialized to ON, and another for loop is used to find the minimum value of OHLC4 over the last 6 bars, excluding the values at the indices of O1 and O2. If the current index is not equal to O1Loc or O2Loc, then the minimum of the current value of O3 and the value at the current index of P is stored in O3.

7. Finally, the "IMA" variable is set to the value of O3, which represents the "IMA" over the last 6 bars.

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?