Gamestudio Links
Zorro Links
Newest Posts
Zorro 3.01 recoded MMI function issue
by TipmyPip. 06/04/26 05:44
SGT_FW
by Aku_Aku. 05/31/26 11:05
ZorroGPT
by TipmyPip. 05/28/26 01:43
Issues resuming trades on Demo account
by Martin_HH. 05/22/26 13:31
XTB
by pr0logic. 05/18/26 12:27
Purchase A8 full licence version
by NeoDumont. 05/13/26 20:17
Black Book, 4th edition
by TipmyPip. 05/11/26 08:40
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 3,288 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Seraphinang, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Active Threads | Active Posts | Unanswered Today | Since Yesterday | This Week
Zorro Scripts
Yesterday at 05:44
It can affect backtesting when MMI is used in a trade condition, filter, optimizer, or ML feature, because the changed MMI value can change whether a signal is true or false.

The original MMI code calculates a median over TimePeriod and then counts rising/falling behavior around that median. Zorro’s indicator source shows the old version using TimePeriod = Min(TimePeriod,g->nBar-1); and Median(Data,TimePeriod). The Median function sorts the data and returns the middle value within the given period.

When the backtest can change
1. When TimePeriod is even

Old:

var m = Median(Data,TimePeriod);

New:

var m = Median(Data,TimePeriod|1);

If TimePeriod = 100, then:

TimePeriod|1 = 101

So the median is calculated from 101 values instead of 100.

That can shift the median slightly. Since MMI compares every value against the median:

if(Data[i] > m && Data[i] > Data[i-1])
nl++;
else if(Data[i] < m && Data[i] < Data[i-1])
nh++;

a small median shift can change nl or nh, which changes the returned MMI value.

This matters if your strategy does something like:

if(MMI(Price,100) > 75)
enterLong();

A value changing from 74.9 to 75.2 can create a trade in one version but not the other.

2. Near the beginning of the backtest or WFO cycle

Old:

TimePeriod = Min(TimePeriod,g->nBar-1);

New:

TimePeriod = Min(TimePeriod,g->nBar-2);

The new version uses one less available bar when history is short.

This can affect the first valid bars after LookBack, or the beginning of a walk-forward cycle, especially if TimePeriod is close to the available history length.

Zorro uses LookBack to execute bars before trading begins so indicators have enough history. The manual says the first bar where trades can be entered is greater than or equal to LookBack, and LookBack should cover the longest period of all used indicators, assets, and time frames.

So this change can affect backtesting mostly when:

LookBack ? MMI period

or when TimePeriod is optimized and sometimes becomes large.

3. When MMI is used as a filter

Example:

vars Price = series(priceClose());
var MeanState = MMI(Price,100);

if(MeanState > 75)
enterLong();

If the old version gives:

MMI_old = 74.8

and the new version gives:

MMI_new = 75.3

then the trade only happens with the new version.

That can change:

entry timing, number of trades, profit factor, drawdown, optimized parameters, WFO results

The Zorro manual notes that indicators often become buy/sell signals when they reach thresholds, cross each other, or cross the price curve.

4. When MMI period is optimized

This is a big one.

Example:

int MMIPeriod = optimize(100,50,300,10);
var M = MMI(Price,MMIPeriod);

If some optimized values are even, the new version internally turns the median length odd:

100 -> 101
120 -> 121
200 -> 201

So the optimizer may find a different best parameter than before.

Zorro’s documentation specifically warns that when optimizing an indicator time period, LookBack should be set to at least the maximum period, otherwise the backtest period can change with the optimized value and affect results unexpectedly.
5 150 Read More
Projects
05/31/26 11:05
The new release - named Lerna - is already halfway done; it just needs a little more time to be completed.
Everything that has been finished so far has already been committed to the repository.
34 12,773 Read More
Starting with Zorro
05/28/26 01:43
This Zorro lite-C script plots a EUR/USD daily chart that combines a traditional SMA indicator with an external ARIMA forecast. It imports selected functions from AutoAri32.dll and defines a minimal AUTO_ARIMA_RESULT structure so the DLL can return the selected ARIMA order, convergence state, forecast value, and AICc score. During each run, the script loads EUR/USD closing prices, calculates a 20-period simple moving average, and skips execution until the LookBack period is complete. The ARIMA model uses the previous 120 completed closing prices to generate a one-step forecast. Before forecasting, the price series is validated, and the result is checked for convergence, invalid values, and a realistic EUR/USD range. If ARIMA fails, the script safely falls back to the previous close. It then plots price, SMA20, ARIMA forecast, and forecast error in pips, while printing diagnostic model statistics to the log.

Code
// Arima01.c
// EUR/USD SMA + ARIMA forecast
// Requires AutoAri32.dll in the same folder as this script.

// Minimal copy of AUTO_ARIMA_RESULT from aa_arima_types.h.
// Field names can be local; order and types must match the DLL.
typedef struct
{
    int p;
    int d;
    int q;
    int converged;

    var sse;
    var aicc;
    var forecast;

    var* ar;
    var* ma;

    int arCap;
    int maCap;

} AUTO_ARIMA_RESULT;

#define PRAGMA_API init_auto_arima_result;AutoAri32!init_auto_arima_result
#define PRAGMA_API free_auto_arima_result;AutoAri32!free_auto_arima_result
#define PRAGMA_API auto_arima_forecast;AutoAri32!auto_arima_forecast
#define PRAGMA_API aa_validate_price_series;AutoAri32!aa_validate_price_series

void init_auto_arima_result(AUTO_ARIMA_RESULT* R);
void free_auto_arima_result(AUTO_ARIMA_RESULT* R);
int auto_arima_forecast(vars Close,int N,var TickSize,int MaxP,int MaxQ,AUTO_ARIMA_RESULT* Result);
int aa_validate_price_series(vars Close,int N);

#define ARIMA_WINDOW 120

function run()
{
    set(PLOTNOW,LOGFILE);

    BarPeriod = 1440;
    LookBack = ARIMA_WINDOW + 50;
    MaxBars = 800;

    PlotWidth = 1200;
    PlotHeight1 = 600;
    PlotBars = 300;

    asset("EUR/USD");

    vars Price = series(priceClose());

    var SMA20 = SMA(Price,20);

    if(is(LOOKBACK))
        return;

    var Forecast = Price[1]; // safe fallback
    int Status = 0;

    AUTO_ARIMA_RESULT R;
    init_auto_arima_result(&R);

    // The library documents price-series validation before model use.
    // It checks positive prices, invalid values, and enough samples.
    if(aa_validate_price_series(Price+1,ARIMA_WINDOW))
    {
        Status = auto_arima_forecast(Price+1,ARIMA_WINDOW,PIP,3,3,&R);

        if(Status and R.converged and !invalid(R.forecast))
        {
            if(R.forecast > 0.5 and R.forecast < 2.0)
                Forecast = R.forecast;
        }
    }

    var ErrorPips = (Price[0] - Forecast) / PIP;

    plot("Close",Price[0],MAIN|LINE,BLUE);
    plot("SMA20",SMA20,MAIN|LINE,RED);
    plot("ARIMA",Forecast,MAIN|LINE,GREEN);
    plot("ErrPips",ErrorPips,NEW|LINE,BLACK);

    printf(
        "\nBar %i Close %.5f SMA20 %.5f ARIMA %.5f Err %.2f pips Status %i p=%i d=%i q=%i AICc %.4f",
        Bar,
        Price[0],
        SMA20,
        Forecast,
        ErrorPips,
        Status,
        R.p,
        R.d,
        R.q,
        R.aicc
    );

    free_auto_arima_result(&R);
}
232 78,765 Read More
Zorro Future
05/22/26 13:31
Finally, I found it.

I used the SaveMode flag variable and had set it to 4 for a dedicated reason. Now, I changed it back to SaveMode=791 and it should work.
I set this a while ago and the more complex the set-up gets ...

For Information from the manual:

These are the SaveMode Flags: (x) are bit code

SV_SLIDERS(2) save/load slider positions (default).
SV_ALGOVARS(4) - save/load all AlgoVars (default).
SV_ALGOVARS2 - save/load all AlgoVars2.
SV_TRADES(1) - save/load all open trades (default).
SV_STATS(16)- save/load statistics data, to be continued in the next session.
SV_BACKUP(256) - after loading, save a backup of the .trd file (default).
SV_HTML(512) - after loading trades in [Test] mode, generate a HTML file with the list of open trades.
4 210 Read More
The Z Systems
05/21/26 12:13
Hello Zorro forum, problem solved. Indeed, I just fixed naming of tickers in the assetlist. IC Markets have different naming for indexes as compared to Afterprime or other brokers. There is obviosly no relevance to USD/CAA or A2_87 strategy. The program was blocked or confused by resolving data from the broker due to missmatsch of ticker names (GER30 vs DE40, NAS100 vs. USTEC, etc.)

If my post is confusing or irrelevant, please admin just erase it or whatever.

Cheers !!
1 129 Read More
Zorro and the Brokers
05/18/26 12:27
Jump to new posts XTB [by pr0logic]
Has someone experience in trading on XTB?
0 116 Read More
Starting with Gamestudio
05/13/26 20:17
I ordered the pro version last week. Payment was executed over PAYGLOBAL. Today I received the A8 Pro Key file. So everything was o.k. I allow myself to confirm that the order link is safe.

NeoDumont

Still love 3Gamestudio. Now that I have everything for a bigger game I will start to create the Game I was dreaming of for a long time.
4 473 Read More
Bug Hunt
05/12/26 09:00
try http://tutorial.3dgamestudio.net

The browser as default is trying to open an httpS link, but you should open http
1 110 Read More
Zorro Future
05/11/26 08:40
Sir, I am also going to publish a book... :-) will you buy my book? please...
1 410 Read More
User Resources
05/10/26 16:04
Hamburg, April 2026

O.K.

Clickpuzzles have been part of adventure games or rpgs for a long time. From DOS adventures from the early 80s over win 3.11 or later windows games you can find them in many many games. From early 2D games up to doom 3 or Skyrim you can find them very often as a challenging part of a point and click adventure or in an advanced 3D Game.

Here is a descripion on how to create a puzzle for your game and also a small Gamestudio 3D example world with sound and moving stones and a gate.

1.

The easyiest way: The password puzzle:

First define a solution string like solution_str = "beans"

Then create an empty input string like input_str = ""


Ask the user/player now to type in the correct code or password.

(In Gamstudio it can be done via inkey (STRING*);)

Compare the solution_str with the input_str.
with str_cmp.

If the 2 strings match something can happen, that what you wanted.


2.

Clicking on the correct sprite in a 3D world from a group of sprites. Only one or two clicks on one or two sprites are allowed. A solution variable must be defined first, lets say to 15 and a zero input variable. Only the sprites which add 7 and 8 to the input variable will solve the puzzle, if the two variables do match. Puzzle must be reset to set input var to zero if clicks were wrong.

3.

Clicking on sprites in a certain order. Each click adds a definded character to the input string. The sequence of the clicked characters should match the solution string when compared.

solution_string="fun"
input_str=""


If clicked on a certain sprite add "f" to the input_str
next:
If clicked on a certain sprite add "u" to input_str
next:
If clicked on a certain sprite add "n" to input_str

compare input_str to solution_str
If they match let things happen.
If not, clear the input_str and start again. You may use sound samples to let the player know that he failed or succeded.


4.

You can also use models of course and add sounds and movements.
The add char to a string method could also be used for getting certain items in a certain order or performing certain actions, one after the other, to trigger something.
Note: In my demo level I use stone mdls with numbers on it. It would be a bit more difficult without any numers. Anyway I leave it up to you what kind of stones or objects/sprites you place in your level as a puzzle input.

Feel free to use the script parts I have created for the puzzle as a barebone for your game.

NeoDumont

Best wishes !


Demo Level Download:

Clickpuzz demo level

[Linked Image]
0 149 Read More
Starting with Zorro
05/08/26 10:59
No, the lite-C compiler output is not directed to a file.
3 280 Read More
Zorro and the Brokers
05/07/26 13:33
Thank you for the info!
35 7,235 Read More

Gamestudio download | 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