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
3 registered members (TipmyPip, AndrewAMD, dBc), 18,430 guests, and 6 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
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: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
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,806
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,806
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