Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (frutza, Quad, AndrewAMD), 385 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
MACD trading #486545
09/04/22 16:28
09/04/22 16:28
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Hello all,

This is my very first post, I just found Zorro yesterday laugh downloaded and played a little, seems like great stuff. I Have a newbie question and excuse me if this was asked before and answered - is there MACD trading strategy (script) already? For futures / forex. I did not see anything with such content in the strategy folder.

Thanks! have a great weekend!

Re: MACD trading [Re: udihamudi] #486549
09/04/22 21:17
09/04/22 21:17
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
I believe you can start with Workshop4.c

and then use MACD indicator to set you own rules for entry/exit https://zorro-project.com/manual/en/ta.htm

Re: MACD trading [Re: alun] #486550
09/04/22 22:22
09/04/22 22:22
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Thanks for the reply! I could not see file called Workshop4.c, only Worhshop_a reference in the above link you provided, where is this file?

Also, I did find the following in Zorro help at
https://zorro-trader.com/manual/en/macd.htm


// when the MACD Histogram goes above zero, buy long
if (crossOver(macdHist(12,26,9),constant(0)))
buyLong(0);
// sell when it goes below zero
if (crossUnder(macdHist(12,26,9),constant(0)))
sellLong(0);


But it doesn't compile, throwing error about macdHist cannot be found. Maybe it's in some external h file?

Re: MACD trading [Re: udihamudi] #486554
09/05/22 09:06
09/05/22 09:06
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
Hey udihamudi,

Workshop4 code can be found here https://zorro-project.com/manual/en/tutorial_trade.htm

It should be distributed with Zorro if you downloaded the latest version.


I believe this MACD example that you're looking at is some outdated one.

There are no buyLong/sellLong functions in my Zorro 2.50

instead you're should be using something like:


Code
vars macd = series(MACD(Prices, 12, 26, 9));

if (crossOver(macd,0)) enterLong();
else if (crossUnder(macd,0)) exitLong();


With prices like in workshop 4.




Last edited by alun; 09/05/22 09:09.
Re: MACD trading [Re: udihamudi] #486557
09/05/22 09:55
09/05/22 09:55
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
BTW I found this nice video on the MACD trading - https://www.youtube.com/watch?v=nmffSjdZbWQ

it suggest you use crossover of a macd and singnal lines as an enter signal and use 200 MA as a trend filter for long/short signals.

It's definitely not set in stone, but some ideas to try.

Re: MACD trading [Re: udihamudi] #486560
09/05/22 12:27
09/05/22 12:27
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Great input thanks, I have seen it and looks genuine, even the reading aloud is automated laugh

I have also found this script in github and backtested it, and the result are quite nice, upside of about %20 on EUR/USD 2021-2022-
https://github.com/grat001/5xcor/blob/master/5xcor_jema.c

Of course I would need to modify it for real life scenarios but good baseline showing we can use MACD in Zorro.

Have you had any success using MACD or other indicators in Zorro (or other platforms)?

Cheers


Last edited by udihamudi; 09/05/22 12:41.
Re: MACD trading [Re: udihamudi] #486561
09/05/22 13:39
09/05/22 13:39
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
Nice, you probably need more data/pairs also do a reality check on a de-trended data before running it live.



Originally Posted by udihamudi


Have you had any success using MACD or other indicators in Zorro (or other platforms)?



No I haven't. At least explicitly - not sure if it's used in Z-systems, e.g. Z1 - if yes than this system seems to be successful.

The main problem with MACD that is't lagging - in fact it'd double lagging cause it applies MA to MA.

I'm not a big fan of indicator soups in general.

Also if you haven't seen this - nice article by jcl adding some insight on where the to look for grail system with more probability of finding it laugh

https://financial-hacker.com/please-send-me-a-trading-system/

Re: MACD trading [Re: udihamudi] #486565
09/05/22 17:06
09/05/22 17:06
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Interesting, I wonder if its possible really to "code" market inefficiencies, market model, data mining etc. in a consistent way for a fire-and-forget bot trading, seems like a lot of hand holding required(?) - vs indicator soup, which is probably easier to automate and train for auto trading (but obviously less profitable).

Have you tried automating these different approaches?

Last edited by udihamudi; 09/05/22 17:07.
Re: MACD trading [Re: udihamudi] #486567
09/05/22 21:53
09/05/22 21:53
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
No I don't believe that such strategy exists TBH.

You can have an ideal unbiased WFO-optimised strategy but real-world Sharpe ratio that I usually see is about 1-1.5.

Meaning the ratio of CAGR vs Drawdown/Equity Volatility.

Also drawdown can persist for about 12 months even for the best strategies - so you need some patience to run them.

Strategies making 12% CAGR with reasonable max drawdowns (around 20%) are quite possible.

If you want more profitability that only goes for the cost of extra risks.

Selling options could be profitable IF done right. I've not yet got there myself.

I'm exploiting one ETF based strategy now live. Investing in cryptos long term.
Investing in some top signals of MQL5 with a small fraction of my portfolio.

And just started to play with Z-systems demo-only so far.


Of course that doesn't mean I'm right - that's just my personal way and experience.

You know, Larry Williams made 11376% in 1987 in a public contest with futures trading, turning $10k into $1147k in 1 year.
His max drawdown was over 50% during that contest.
That's an outstanding result, still - achievable.

https://distinct-radio-154.notion.site/Larry-Williams-87-5d242d40743044f880d73609eafa9069

Last edited by alun; 09/05/22 22:02.
Re: MACD trading [Re: udihamudi] #486568
09/06/22 01:53
09/06/22 01:53
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Which of the Zs are you trying if I may ask? how successful is it so far? when I ran the simulator for Z2 - result are just little better than break-even, including training .. not great frown . The MACD script I found did way better for similar span and same currency (EUR/USD) and I didn't even do any optimization yet.

This Z is concerning me a little, since its kinda black box, isn't that exactly what Zorro warning against in this hacker article laugh you cant's see the source code and obviously can't modify it. Are you comfortable enough to try it in real account?

My "dream" here is to chime in to various live data feeds, stock fundamentals feed etc., maybe throw in some indicators, candlestick/chart pattern, and see if I can I can write algo that will make sense of it all - but I don't know if its possible with Zorro. Use it for either forex or futures.

Outside of this I am playing a little with futures on live account, really little money for now, 80% upside so far but it's been really short time and I am spending way to much time in market research and manual monitoring ... this stuff should all be done by a nice little robot, it's crazy to spend so much time on this mechanical work and there is no reason not to automate if I can qualify my strategy

Have good week!

Re: MACD trading [Re: udihamudi] #486569
09/06/22 08:44
09/06/22 08:44
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
I'm trying Z1 which is trend following portfolio of strategies. Backtest using 8 years data from Dukascopy currencies and CFD looked good. Trying live on a demo now. Current result +600$ in two trades it made so far grin

Z2 is mean reversion. Which supposed to be coupled with Z1 and there is Z12 which does white (Zorro S only).

Well I'm investing in signals for many years which are the same blackboxes - you just need to accept 100% deposit risk. And only put small fraction of your portfolio into this game.

On the other side some of those signals making more 5000% over the span of few years. So I look at it as 50:1 risk reward investment.

I'm looking at the Z1/Z2 systems the same way - I find their performance on backtests very good for my needs. I only hope there is no look ahead or selection bias.

With signals there is definitely selection bias (survivorship bias) but the monitoring is of live trading not backtest so at leat the look-ahead is excluded.

You can use Zorro for stocks there is nothing in relation to fundamentals analysis in its standard toolset. But you can load/process the data in Zorro manually.

Best luck with your futures stategy.

Re: MACD trading [Re: udihamudi] #486571
09/06/22 10:04
09/06/22 10:04
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65

Re: MACD trading [Re: udihamudi] #486577
09/06/22 23:55
09/06/22 23:55
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Thanks for sharing!! Congrats on the successful trade laugh I have td ameritrade account, maybe I can try the z1 there, probably need api key, wil update you

Re: MACD trading [Re: udihamudi] #486578
09/06/22 23:57
09/06/22 23:57
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Btw where are the z systems documented?

Re: MACD trading [Re: udihamudi] #486584
09/07/22 15:33
09/07/22 15:33
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
Not sure about Ameritrade, Z1 trades mainly Forex and CFD based.

I doubt Ameritrade gives you CFD as you'd rather have normal stocks and futures.

Yes ZSystems are documented here https://zorro-project.com/manual/en/zsystems.htm

Re: MACD trading [Re: udihamudi] #486596
09/08/22 20:48
09/08/22 20:48
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
I been chasing TD Ameritrade support and you right, they have API but it only allowing stocks, no futures or forex (which is what I want). Which USA broker would you recommend that works well with Zorro for futures / forex? btw CFD is not allowed in US.

I have also Tastyworks but their API is still in development so can't use it. I have also Fidelity but no API.

Cheers

Re: MACD trading [Re: udihamudi] #486598
09/08/22 21:11
09/08/22 21:11
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Oanda, hands down.

Re: MACD trading [Re: udihamudi] #486605
09/09/22 18:09
09/09/22 18:09
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Do you know if I can use free zorro to enter orders for Oanda?

Re: MACD trading [Re: udihamudi] #486606
09/09/22 18:14
09/09/22 18:14
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Yes, Oanda is free to use with Zorro:
https://zorro-project.com/manual/en/restrictions.htm

Re: MACD trading [Re: udihamudi] #486611
09/09/22 20:12
09/09/22 20:12
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Does the free zorro allow to send orders to Oanda or just get historic data? Can it subscribe to real time market data from Oanda?

Is all this documented per broker laugh

Thanks!!

Last edited by udihamudi; 09/09/22 20:13.
Re: MACD trading [Re: udihamudi] #486612
09/09/22 20:17
09/09/22 20:17
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted by udihamudi
Does the free zorro allow to send orders to Oanda or just get historic data? Can it subscribe to real time market data from Oanda?
Yes, yes, and yes.

Re: MACD trading [Re: udihamudi] #486613
09/09/22 20:18
09/09/22 20:18
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted by udihamudi
Is all this documented per broker laugh
This is also a yes. There's a manual page for every broker plugin.

Re: MACD trading [Re: udihamudi] #486615
09/09/22 22:10
09/09/22 22:10
Joined: Sep 2022
Posts: 13
Newark
U
udihamudi Offline OP
Newbie
udihamudi  Offline OP
Newbie
U

Joined: Sep 2022
Posts: 13
Newark
Great thanks! Can you point me to the above documentation?

Re: MACD trading [Re: udihamudi] #486618
09/10/22 11:19
09/10/22 11:19
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
You must be new here if you don't know how to find it.

Open Zorro, click [Help]. On the left, go to the Search Tab, and type "oanda" and hit enter. It's the first match.

Page 1 of 3 1 2 3

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1