Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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: 585
Austria
Petra Offline
Support
Petra  Offline
Support

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

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