Posted By: Rdj91
Take trades when MAs touch the same candle stick - 09/16/22 18:08
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
Posted By: Petra
Re: Take trades when MAs touch the same candle stick - 09/17/22 10:19
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) ...
Posted By: Rdj91
Re: Take trades when MAs touch the same candle stick - 09/17/22 11:25
Thanks for the reply I have been looking into coding courses and or books, is there any you recommend,
Posted By: Rdj91
Re: Take trades when MAs touch the same candle stick - 09/17/22 18:39
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
Posted By: AndrewAMD
Re: Take trades when MAs touch the same candle stick - 09/17/22 20:30
C is a simpler language than C++. When in doubt, start with C.
Posted By: Rdj91
Re: Take trades when MAs touch the same candle stick - 09/18/22 08:47
ok thanks i will look in to C