Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/16/24 11:18
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
7 registered members (VoroneTZ, 11honza11, ricky_k, Nymphodora, rki, 7th_zorro, Volkovstudio), 433 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Simple Fat Strategy #449168
03/06/15 14:18
03/06/15 14:18
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
I have tried, but I know, I am not good enough to manually trade, in the continuous battle between logic and emotions, my logic is easily defeated.

So I have spent some time looking for a reliable platform to develop automated strategies. There are only few platform on the market that have automated portfolio (multi-asset/multi-rules) strategy focus.
Most trading platform are very attractive, nice GUI and nice graphs everywhere but unusable for automated trading.

So you can imagine how easily I fall in love with Zorro (Graphics Interface will be welcome anyway). I have been able to achieve results in the first day, that was simple impossible with MT4.

Ok, now we have the tool, let's use it!

The goal is to create a profitable, robust, open, free, strategy; developed, improved and maintained by Zorro's users.

Unfortunately This is not an easy task mainly because Zorro has no tool for cooperative software design, no code versioning support. Even the language support is a limit and script encapsulation can not easily be done.

On the other hand is so easy in Zorro that some pain could be accepted laugh

Let's start in order to cooperate we need to define:

  • Set measurable goals
  • Define the Traded assets
  • The Broker
  • Select, Improve, Discard Strategies
  • Define a testing methodology
  • Melt everything together with a skeleton procedure (the Run Function)


I will clear out all the above points in the following posts.

Now I need to stress out the method. Everything can be changed, but I have to stress out that in order to be successful we need to speak the same language i.e. if we present fantastic testing results using different assets, different testing periods and different testing methodology is for sure useful from educational purposes, but not really useful for our goals. To keep it simple with the actual single core Zorro training and testing the initial FAT strategy takes hours... Let's try to be focused

the Fat Strategy 1.0 that I will introduce as a common starting point acchieve a CAGR of 100%, but is way far to be tradable even in demo. A long work have to be done...


I hope to welcome many users helping me in this projects.

DISCLAIMER
I do not have nothing to sell o to promote, I do this for passion.
My goal is to trade my own strategy live asap. I do not recommend anybody to do same. If You will do it, you will do it at your own risk.
I am not good in coding.
I am not an expert in trading.
I am not a guru in testing.
If you wanna improve anything of my job you are more than welcome

Re: Simple Fat Strategy [Re: MatPed] #449169
03/06/15 14:18
03/06/15 14:18
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Ok The goals and some assumptions:
Testing Z12 with standard parameters (just push the test button) produce the following results:

Quote:
Z12.28: FX PH Max 100 Hedg 5 Wknd 2 Verb 2
Walk-Forward Test: Z12 portfolio 2008..2015

Monte Carlo Analysis... Median AR 98%
Profit 8743$ MI 189$ DD 1294$ Capital 2240$
Trades 3040 Win 42% Avg +11.0p Bars 18
AR 101% PF 1.39 SR 1.35 UI 8% R2 0.56
Time 00:05:42


The idea is to perform at least as good as this system with except of AR. I think we should not focus too much on AR because we will use the compounding features as a key aspect as our money management, so in short period we could outperform the net gain of Z12 in short period.
Not only, thanks of the complete openness of the Fat Strategy we can peek up different assets in order to achieve a better growth.
I have defined 3 assets set:
  • the full set for z12 comparison and final/live testing
  • the mini set for intermediate testing: 2 pairs, one metal and one index. The first version of the FS performs better on this.
  • the test set, used only for debugging and code testing, meaningless for evaluating results


The compound flag could be turned on or off from the very beginning and, as you can imagine, this has a huge impact on the results after few months.

I have not been able to investigate this, but i suggest to train without compounding. I do not know if the optimizing engine in Zorro deactivates this functionality or not while optimizing automatically.

Lets see how the Fat Strategy Build #002 performs

NO COMPOUNDING
Quote:
Fat Strategy 002 compiling................. Assets...........
Walk-Forward Test: Fat Strategy 002 portfolio 2009..2014
Read Fat Strategy 002.fac Fat Strategy 002_1.par Fat Strategy 002_2.par Fat Strategy 002_3.par Fat Strategy 002_4.par Fat Strategy 002_5.par
Monte Carlo Analysis... Median AR 110%
Profit 29051$ MI 1180$ DD 9594$ Capital 14355$
Trades 3551 Win 51% Avg +226.2p Bars 611
AR 99% PF 1.81 SR 0.83 UI 35% R2 0.25
Generate Chart - please wait... ok


COMPOUNDING
Quote:
Fat Strategy 002 compiling................. Assets...........
Walk-Forward Test: Fat Strategy 002 portfolio 2009..2014
Read Fat Strategy 002.fac Fat Strategy 002_1.par Fat Strategy 002_2.par Fat Strategy 002_3.par Fat Strategy 002_4.par Fat Strategy 002_5.par
Monte Carlo Analysis... Median AR 161%
Profit 15828$ MI 643$ DD 2060$ Capital 3512$
Trades 768 Win 55% Avg +134.9p Bars 1066
CAGR 1558% PF 4.18 SR 1.03 UI 20% R2 0.00


As you can imagine from the stats the equity curve is horrible! But now think that i have used only the TS presented in the zorro's manual and in the zorro's video and you can see that we should improve this quite easily...

What I like of the FS at this stage

  • It works
  • it's a ready to use skeleton to work on and cooperate


  • What I do not like
  • Coding design have to be inproved this will be my first goal beacuse it is the workbench for the future development. A good implementation will speed up the rest of the work.

    Quote:
    FAT STRATEGY build 0002
    // Build 0002

    //#define ASSETLOOP "EUR/USD","GBP/USD","USD/CAD","AUD/USD","USD/JPY", "XAU/USD", "XAG/USD","NAS100","SPX500","GER30","US30","UK100"//FOREX SET

    #define ASSETLOOP "EUR/USD","USD/JPY","XAU/USD","SPX500"//MIN FOREX SET

    //#define ASSETLOOP "EUR/USD" //test asset

    #define CMP 0 // 0: Activate compound. Any non zero value no compound. Not sure if required, bur always train with non zero, trade as you like


    // equity curve trading: switch to phantom mode when the equity
    // curve goes down and is below its own lowpass filtered value
    function checkEquity()
    {
    if(Train) { Lots = 1; return; } // no phantom trades in training mode
    vars EquityCurve = series(ProfitClosed+ProfitOpen);
    vars EquityLP = series(LowPass(EquityCurve,10));
    if(EquityLP[0] < LowPass(EquityLP,100) && falling(EquityLP))
    Lots = -1; // drawdown -> phantom trading
    else
    Lots = 1; // profitable -> normal trading
    }

    function enterFSLong()
    {
    if(CMP == 0) {
    Margin = OptimalFLong * Capital * sqrt(1 + max(0,(WinLong-LossLong))/Capital)/100;
    enterLong();
    } else enterLong();
    }

    function enterFSShort()
    {
    if(CMP == 0) {
    Margin = OptimalFShort * Capital * sqrt(1 + max(0,(WinShort-LossShort)/Capital))/100;
    enterLong();
    } else enterLong();
    }

    function CLSTR()
    {
    TimeFrame=24;

    Stop = 2*ATR(14);
    Trail = Stop;
    TrailLock = 10;

    checkEquity();

    var dayL = optimize(40,10,80);
    var dayS = optimize(40,10,80);

    if (priceHigh() >= HH(dayL)) enterFSLong();
    if (priceLow() <= LL(dayS)) enterFSShort();
    }

    function CNTR()
    {
    TimeFrame = 4;
    Trail = 0;

    vars Price = series(price());
    vars Filtered = series(BandPass(Price,optimize(30,20,40),0.5));
    vars Signal = series(Fisher(Filtered,500));
    var Threshold = optimize(1,0.5,1.5,0.1);

    checkEquity();

    if(crossUnder(Signal,-Threshold)) enterFSLong();
    else if(crossOver(Signal,Threshold)) enterFSShort();
    }

    function TRND()
    {
    TimeFrame = 1;
    Stop = optimize(4,2,8) * ATR(100);
    Trail = 0;

    var compound = CMP;
    vars Price = series(price());
    vars Trend = series(LowPass(Price,optimize(500,300,800)));

    checkEquity();

    if(valley(Trend)) enterFSLong();
    else if(peak(Trend)) enterFSShort();
    }

    function run()
    {
    set(PARAMETERS+FACTORS); // generate and use optimized parameters and factors

    BarPeriod = 60; // 1 hour bars
    LookBack = 10000; // needed for Fisher()
    NumWFOCycles = 6; // activate WFO

    StartDate = 2009;
    EndDate = 2014;
    Hedge=5;

    if(CMP==0) Capital=5000;

    if(ReTrain) {
    UpdateDays = -1; // update price data from the server
    SelectWFO = -1; // select the last cycle for re-optimization
    reset(FACTORS); // don't generate factors when re-training
    }
    NumWFOCycles = 6; // activate WFO



    // portfolio loop
    while(asset(loop(ASSETLOOP)))
    while(algo(loop("TRND","CNTR","CLSTR")))
    {
    if(Algo == "TRND")
    TRND();

    if(Algo == "CNTR")
    CNTR();

    if(Algo == "CLSTR")
    CLSTR();
    }

    PlotWidth = 700;
    PlotHeight1 = 400;
    //ColorUp = ColorDn = ColorWin = ColorLoss = 0; // don't plot candles and trades
    //set(TESTNOW+PLOTNOW);
    }


    A long way to go...

Last edited by MatPed; 03/08/15 16:46.
Re: Simple Fat Strategy [Re: MatPed] #449170
03/06/15 14:18
03/06/15 14:18
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Reserved

Re: Simple Fat Strategy [Re: MatPed] #449171
03/06/15 14:18
03/06/15 14:18
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Reserved

Re: Simple Fat Strategy [Re: MatPed] #449178
03/06/15 16:03
03/06/15 16:03
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
A remark about code versioning: We're using Tortoise. It works very well with Zorro scripts.

Re: Simple Fat Strategy [Re: jcl] #449180
03/06/15 16:09
03/06/15 16:09
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Thank you, I will give a look to it, lets see how the community will like this 3d and lets move forward from that point.

Re: Simple Fat Strategy [Re: MatPed] #449190
03/07/15 10:29
03/07/15 10:29
Joined: Jul 2013
Posts: 75
R
royal Offline
Junior Member
royal  Offline
Junior Member
R

Joined: Jul 2013
Posts: 75
Great idea! I will try to contribute if I can laugh

Re: Simple Fat Strategy [Re: royal] #449209
03/08/15 13:57
03/08/15 13:57
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Welcome Royal, we have a tons of work to do. The first version of the strategy in on post #449169.

Ciao

Last edited by MatPed; 03/08/15 15:00.
Re: Simple Fat Strategy [Re: MatPed] #449219
03/09/15 02:22
03/09/15 02:22
Joined: Feb 2014
Posts: 181
R
RTG Offline
Member
RTG  Offline
Member
R

Joined: Feb 2014
Posts: 181
What about a component based upon the triangle breakout system from the book Trading Systems: A New Approach to System Development and Portfolio Optimisation [Emilio Tomasini, Urban Jaekle?

Re: Simple Fat Strategy [Re: RTG] #449221
03/09/15 04:05
03/09/15 04:05
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Yes, great idea.
In this moment I am focusing on money management, the sliders, the other tools and pieces of information meeded to get FS ready to be tested on demo account. Live testing are the more time consuming one and I wanna try to start asap.

I will be glad if you can provide us your strategy in a way that could be easily integrate with little, or better no change, to the Run function.
Please try to use the service functions already provided in order to have from day one Equity control and Compound profit already available.

Give us your advice if you think that your strategy should replace one of the strategy already presented or just added.

If you have improvement in this areas too, please suggest it in separate forum in order that will be easier for me to put the different contribution all together.

Thank you in advance for all you efforts!

Page 1 of 2 1 2

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1