Gamestudio Links
Zorro Links
Newest Posts
New Lic: When does the Support clock start?
by Student_64151. 07/17/26 01:38
New Zorro version 3.11
by madpower2000. 07/16/26 13:49
What are you working on?
by NeoDumont. 07/15/26 16:38
Z9 getting Error 058
by jcl. 07/15/26 15:07
Zorro version 3.0 prerelease!
by madpower2000. 07/14/26 20:11
Accepting new programming clients
by AndrewAMD. 07/14/26 19:32
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Student_64151, TipmyPip), 1,513 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Take trades when MAs touch the same candle stick #486679
09/16/22 18:08
09/16/22 18:08
Joined: Aug 2022
Posts: 8
R
Rdj91 Offline OP
Newbie
Rdj91  Offline OP
Newbie
R

Joined: Aug 2022
Posts: 8
Hi I have looked at the manual but can’t find what I’m after,
I would like too take trades long or short when my 2 moving averages both touch the same candle stick take long trades when the 8 MA is above the 20 and vice Versa, I can see how you code a MA cross over but not seen what I’m after.
Thanks

Re: Take trades when MAs touch the same candle stick [Re: Rdj91] #486683
09/17/22 10:19
09/17/22 10:19
Joined: Apr 2008
Posts: 600
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 600
Austria
Not the Zorro manual but a C course is better for codng questions.

You combine conditions with the && operator. For finding if MA1 and MA2 touch the same candle stick:

if(priceH() >= MA1 && priceL() <= MA1 && priceH() >= MA2 && priceL() <= MA2 && MA1 > MA2) ...

Re: Take trades when MAs touch the same candle stick [Re: Rdj91] #486684
09/17/22 11:25
09/17/22 11:25
Joined: Aug 2022
Posts: 8
R
Rdj91 Offline OP
Newbie
Rdj91  Offline OP
Newbie
R

Joined: Aug 2022
Posts: 8
Thanks for the reply I have been looking into coding courses and or books, is there any you recommend,

Re: Take trades when MAs touch the same candle stick [Re: Petra] #486686
09/17/22 18:39
09/17/22 18:39
Joined: Aug 2022
Posts: 8
R
Rdj91 Offline OP
Newbie
Rdj91  Offline OP
Newbie
R

Joined: Aug 2022
Posts: 8
Hi, would you recommend learning C++ or C I haven’t done any coding and will be only using it for zorro at the moment,
Thanks

Re: Take trades when MAs touch the same candle stick [Re: Rdj91] #486687
09/17/22 20:30
09/17/22 20:30
Joined: Feb 2017
Posts: 1,821
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,821
Chicago
C is a simpler language than C++. When in doubt, start with C.

Re: Take trades when MAs touch the same candle stick [Re: AndrewAMD] #486688
09/18/22 08:47
09/18/22 08:47
Joined: Aug 2022
Posts: 8
R
Rdj91 Offline OP
Newbie
Rdj91  Offline OP
Newbie
R

Joined: Aug 2022
Posts: 8
ok thanks i will look in to C


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1