Heikin Ashi Advanced – help with simple code
Forums › ProRealTime English forum › General trading discussions › Heikin Ashi Advanced – help with simple code
- This topic has 5 replies, 3 voices, and was last updated 10 months ago by lingier.
-
-
02/11/2024 at 1:28 PM #227915
I love the following indicator, created by Gidien: https://www.prorealcode.com/prorealtime-indicators/heikin-ashi-advanced/
I’m interested in incorporating this indicator into my trading strategy, but I’m not well-versed in coding.
As a beginner, I’d appreciate assistance with the following:- Buy when the candlestick is green.
- Sell when the candlestick is red.
This would already mean a step forward for me.
I hope someone can assist me with this
Gr
02/11/2024 at 2:32 PM #227918Good morning
For example
purchase:
F= ao < ac and ao[1]>ac[1]
if F then
BUY 10000 CASH at market
SET STOP %LOSS ts
SET target %profit tp
endifsale :
G= ao > ac and ao[1]<ac[1]
if G then
SELL 10000 CASH at market
SET STOP %LOSS ts
SET target %profit tp
endif02/11/2024 at 3:05 PM #227920Hi,
Here is the system that buys when the color changes to green and sells when the color changes to red…
Heikin Ashi Adv. System123456789101112131415161718192021222324252627282930313233// ############# Heikin-Ashi Advanced ##################################################// Written by GSLDefParam CumulateOrders=Falsebo = Average[MAX(1,sma1),AverageType1](Open)bh = Average[MAX(1,sma1),AverageType1](high)bl = Average[MAX(1,sma1),AverageType1](low)bc = Average[MAX(1,sma1),AverageType1](close)IF BarIndex <= sma1 + 1 THENhaOpen = bohaClose = bchaHigh = bhhaLow = bl//PRINT(haClose)ELSehaOpen = (haOpen[1] + haClose[1]) / 2haClose = (bo + bc + bl + bh ) / 4haHigh = MAX( MAX(bh , haOpen), haClose )haLow = MIN( MIN(bl , haOpen), haClose )ao = Average[MAX(1,sma2),AverageType2](haOpen)ah = Average[MAX(1,sma2),AverageType2](haHigh)al = Average[MAX(1,sma2),AverageType2](haLow)ac = Average[MAX(1,sma2),AverageType2](haClose )ENDIFIF ao < ac THENBuy 1 contract at MarketELSIF ao > ac THENSellShort 1 contract at MarketEndIf02/11/2024 at 3:31 PM #227926Thx for the *.itf , JS.
In your screenshot, it indeed seem to do the trick, exactly how I would want it. But in my workstation, it appears different.
Also the name of the backtest appears as (0 0 48 26) and not as (0 0 f 7 3)Maybe this is because I’m using it on timeframes of 1 week? Any tips?
02/11/2024 at 4:07 PM #22793202/11/2024 at 4:07 PM #227933 -
AuthorPosts
Find exclusive trading pro-tools on