Close of Heiken-Ashi bar crosses specified value


0
0

Hello Pete,

Forgive me if this has been already asked–I couldn’t find it. Looking to see if it’s possible to create an alert at the close of a Heiken Ashi 15 minute candle above or below a certain price level (that I set manually).

 

I called TOS and they said their text alerts define “Close” as close of the day only, not candle (even with trying to modify conditions)

 

Thank you in advance and I hope your weekend is going well

-Nirav

Marked as spam
Posted by (Questions: 1, Answers: 4)
Asked on September 19, 2021 8:56 am
132 views
0
Private answer

You left out very crucial details in the title you entered for this question so I have updated it to assist the rest of our viewers to discover this using the search function.

Heiken-Ashi bars are not available for alerts and scans so the solution must first compute the Heiken-Ashi close before it can be used to generate an alert.

The solution below includes a user input at the top of the code to serve as the alert level. This allows users to adjust the alert level without modifying the structure of the code. Only one signal can be used at any given time so I have included signals for both directions but marked one as a comment so it does not create an error. Simply move the "#" symbol to control which of the two signals to activate when setting up your alert.

The code itself does not know anything about the time frame. So you can apply this to any of the time frames supported by whichever tool you select: (Scan, Study Alert or Conditional Order).

input alertLevel = 150.00;
def haClose = ohlc4;
def signalAbove = haClose[1] < alertLevel and haClose > alertLevel;
def signalBelow = haClose[1] > alertLevel and haClose < alertLevel;
# use this to scan for cross above alert level
plot signal = signalAbove[1];
# use this to scan for cross below alert level
#plot signal = signalBelow[1];

The signals are set to alert only after the signal bar closes [1].

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on September 19, 2021 12:51 pm