Gamestudio Links
Zorro Links
Newest Posts
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
phantom() not defined in indicators.c
by jcl. 08/07/26 11:45
Pause button for evaluation shell?
by jcl. 08/07/26 11:43
Accepting new programming clients
by AndrewAMD. 08/06/26 21:25
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (LapHoan, 1 invisible), 4,156 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LapHoan, ZeonLau, Ponti233, riggi89, shuhari
19230 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,131
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,131
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