Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
6 registered members (TipmyPip, Niels, dBc, Ed_Love, 3run, 1 invisible), 17,843 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Heiken-Ashi Indicator #442651
06/28/14 04:12
06/28/14 04:12
Joined: Jan 2014
Posts: 41
K
killerkhan Offline OP
Newbie
killerkhan  Offline OP
Newbie
K

Joined: Jan 2014
Posts: 41
Helo jcl, how do I code Heiken-Ashi Indicator in zorro s?

http://www.dailyfx.com/forex/education/t..._Indicator.html

how would I convert something like this pseudo code into zorro lite-c code?

===================
== Entry conditions
===================
LongEntryCondition = ((Open(9) > HeikenAshiLow(17)) Or (ATR(76) Crosses Below ATR(67)))
ShortEntryCondition = ((Open(9) < HeikenAshiHigh(17)) Or (ATR(76) Crosses Above ATR(67)))


===================
== Entry orders
===================
-- Long entry
if LongEntryCondition is true {
Reverse existing order (if any) and Buy on open at Market;
Stop Loss = 98 pips;
}

-- Short entry
if ShortEntryCondition is true {
Reverse existing order (if any) and Sell on open at Market;
Stop Loss = 98 pips;
}

Re: Heiken-Ashi Indicator [Re: killerkhan] #442700
06/30/14 10:35
06/30/14 10:35
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Pseudo code is easily converted to Zorro Code. For Haikin Ashi:

Close = (Open+High+Low+Close)/4
Open = [Open (previous bar) + Close (previous bar)]/2
High = Max (High,Open,Close)
Low = Min (Low,Open, Close)

==>

vars Close = series((priceOpen()+priceHigh()+priceLow()+priceClose())/4);
vars Open = series((priceOpen(1)+priceClose(1))/2);
vars High = series(max(priceHigh(),max(priceOpen(),priceClose())));
vars Low = series(min(priceLow(),min(priceOpen(),priceClose())));

Only take care to count correctly the number of brackets. wink


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1