3D plot with optimization not showing properly

Hello people,

I have a very simple system which I tested on BTC (dataset: 2018-2021. I tried using the 3D plot to see some results of the system with a 2 parameter optimization. Somehow the 3D plot is not showing properly. I was hoping you could help me out.

I have an NVIDIA GEFORCE GT 1030 which has the latest updates.

// initial capital
capital=100000;
SetOption("InitialEquity",capital); 
RoundLotSize=1;

MA1f=Optimize("MA slow",18,2,50,1);
MA2f=Optimize("MA fast",9,2,25,1);
Exclude=(MA2f>=MA1f);

MA1=MA(Close,MA1f);
MA2=MA(Close,MA2f);
Buy=(Cross(MA2,MA1) AND Close>MA2);
Sell=Cross(MA1,MA2);

Short=(Cross(MA2,MA1) AND Close<MA2);
Cover=Cross(MA1,MA2);

//position sizing
SetPositionSize(100,spsPercentOfEquity);

3D plot:

image

User error.

You must not use Exclude statement.

3D Charts require ALL EXHAUSTIVE STEPS.

3 Likes

Worked perfectly, thank you very much!

I wanted to see if this was documented. So I looked here AmiBroker Knowledge Base » Using Exclude statement to skip unwanted optimization steps and here How to optimize trading system.

Perhaps this is documented somewhere, but I couldn't find it on those two links.

How is this User error if this isn't documented? Wouldn't it be Documentation error instead?

No-one on this planet is able to envision in advance all possible user errors.
Besides the number of errors that people may "invent" is infinite.

Some things are just obvious. 3D Graph requires entire GRID of results because it needs X,Y,Z co-ordinates of every point to be drawn in the rectangular grid. If data are missing, grid is incomplete. That is such obvious thing like you can't drive the car that is missing one of its wheels (again assumption is that car has a grid 2x2 and all grid points must be fitted with wheels). Users manual for the car does not mention that you shouldn't drive with some wheels missing, does it?

3 Likes

Anyway, @Tomasz, to avoid this kind of issue in the future, I suggest updating - with a specific warning - the documentation and the above linked article.

I understand your point of view, but you should concede that what is immediately apparent to you as an expert developer may not be so obvious to many of your customers (i.e., how many of us ever worked/coded a 3D system?) ! :slightly_smiling_face:

1 Like

IMHO, no-one would ever notice the warning in the docs. I've been there so many times. If anything, what would make sense is a a warning directly in the program when somebody tries to use 3D chart using formula with Exclude statement.

3 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.