Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 10/24/26 01:54
Tradestation missing in table of contents
by AndrewAMD. 10/23/26 14:35
No connection to MT4
by JeyKey II. 10/22/26 15:33
Zorro tutorial ideas?
by mistery. 10/21/26 05:28
Avoid "log\ - delete old files" message
by Martin_HH. 10/20/26 07:23
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 6,823 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Incorrect OptimalF #441279
05/17/14 15:17
05/17/14 15:17
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
From a .fac file:
Code:
AUD/JPY             .1000  9.29  211/111  55.4
AUD/JPY:L           .999  9.29  211/111   55.4
AUD/JPY:S           .000  ----    0/0      0.0


Is that enough for you to trace the problem, or do you need a demo?

Last edited by GPEngine; 05/17/14 15:17. Reason: fixed width
Re: Incorrect OptimalF [Re: GPEngine] #441280
05/17/14 15:22
05/17/14 15:22
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
In the Performance Report
Code:
AUD/JPY             .100  1.28  164/158   51.5  /\
AUD/JPY:L           .999  1.28  164/158   51.5  /\
AUD/JPY:S           .000  ----    0/0      0.0  ..


Re: Incorrect OptimalF [Re: GPEngine] #441316
05/19/14 07:51
05/19/14 07:51
Joined: Jul 2000
Posts: 28,142
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,142
Frankfurt
Yes, .1000 is wrong. From what I see it should be .999 instead. So we'll have to look into the problem, and will indeed need the script where this happens.

Re: Incorrect OptimalF [Re: jcl] #441349
05/20/14 02:06
05/20/14 02:06
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
I think it is related to my other post.
I can only reproduce this problem after setting Capital and providing Margin = -1.#IND00 in one strategy (which we established is a Bad Move). Then Zorro seems to be in a permanently confused state until restart, affecting other Strategies in the meantime. But, I tried and cannot develop steps to reproduce this bad state. So I can't prove it to you.

Re: Incorrect OptimalF [Re: GPEngine] #441354
05/20/14 04:28
05/20/14 04:28
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
Ah-ha. I got it to happen on its own.
Code:
#define BANK 50000.0
string selected_asset;

function run() {
  BarPeriod = 80;
  LookBack = 501;
  StartDate = 20130701;
  EndDate = 20140420;
  set(TICKS + LOGFILE + MUTE);
  set(RULES);
  set(PLOTNOW);
  set(TESTNOW);
  set(FACTORS);
  if (Train) {
    Hedge = 2;
    Detrend = 1;
  } else {
    set(NFA + MARGINLIMIT + ACCUMULATE);
    Hedge = 4;
    Detrend = 0;
  }
  TradesPerBar = 2;
  Weekend = 1;
  ExitTime = 24 * 60 / BarPeriod;
  NumWFOCycles = 3;
  Confidence = 75;
  float max_margin_per_trade = BANK / ((ExitTime + 1) * TradesPerBar);

  while(selected_asset = loop(
"EUR/CAD", "EUR/CHF", "EUR/GBP", "EUR/USD", "GBP/CAD", "GBP/USD", "USD/CAD"
    )) {
    asset(selected_asset);

    var atrx = ATR(200);

    Stop = 1.0;
    TakeProfit = 2.0;

    vars Price = series(price());
    var v01 = WillR(228);
    plot("v01", v01, LINE+NEW, BLUE);
    var v02 = WillR(155);
    plot("v02", v02, LINE+NEW, BLUE);
    var pattern76888[6] = { 7, 6, 8, 8, 8, -1 };
    var v03 = detect(Price, 0, 10*PIP, pattern76888);
    plot("v03", v03, LINE+NEW, BLUE);

    if (adviseShort(PERCEPTRON, 0, v01, v02, v03) > 0) {
      Margin = OptimalFShort * max_margin_per_trade;
      enterShort();
    }

    if (adviseLong(PERCEPTRON, 0, v01, v02, v03) > 0) {
      Margin = OptimalFLong * max_margin_per_trade;
      enterLong();
    }
  }
}



First question, why is OptimalFShort zero for all assets?

Second question, are these OptF values correct? It seems to me that all OptimalF (both side) values are wrong.
Code:
EUR/CHF             .100  0.46  331/598  -251.2 \\
EUR/CHF:L           .000  0.46  331/598  -251.2 \\
EUR/CHF:S           .000  ----    0/0      0.0  ..
EUR/USD             .100  1.21  432/394  108.1  /\
EUR/USD:L           .517  1.21  432/394  108.1  /\
EUR/USD:S           .000  ----    0/0      0.0  ..
GBP/CAD             .100  1.25  429/448  191.9  /\
GBP/CAD:L           .522  1.25  429/448  191.9  /\
GBP/CAD:S           .000  ----    0/0      0.0  ..
GBP/USD             .100  1.19  355/355   75.0  //
GBP/USD:L           .563  1.19  355/355   75.0  //
GBP/USD:S           .000  ----    0/0      0.0  ..
USD/CAD             .100  0.97  381/469  -23.8  /\
USD/CAD:L           .000  0.97  381/469  -23.8  /\
USD/CAD:S           .000  ----    0/0      0.0  ..


Code:
EUR/CAD             .1000  0.89  371/431  -1.3
EUR/CAD:L           .000  0.89  371/431   -1.3
EUR/CAD:S           .000  ----    0/0      0.0
EUR/CHF             .1000  21.99  898/31  19.9
EUR/CHF:L           .999  21.99  898/31   19.9
EUR/CHF:S           .000  ----    0/0      0.0
EUR/USD             .1000  16.77  716/110 20.9
EUR/USD:L           .999  16.77  716/110  20.9
EUR/USD:S           .000  ----    0/0      0.0
GBP/CAD             .1000  9.75  690/187  25.7
GBP/CAD:L           .999  9.75  690/187   25.7
GBP/CAD:S           .000  ----    0/0      0.0
GBP/USD             .1000  26.41  644/66  20.8
GBP/USD:L           .999  26.41  644/66   20.8
GBP/USD:S           .000  ----    0/0      0.0
USD/CAD             .1000  7.22  639/211  14.1
USD/CAD:L           .999  7.22  639/211   14.1
USD/CAD:S           .000  ----    0/0      0.0


Re: Incorrect OptimalF [Re: GPEngine] #441355
05/20/14 05:34
05/20/14 05:34
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
For question 1, regarding lack of sell-side action, I think it has something to do with Detrend=1 but I can't figure out why the effect would be so profound.

Re: Incorrect OptimalF [Re: GPEngine] #441359
05/20/14 07:22
05/20/14 07:22
Joined: Jul 2000
Posts: 28,142
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,142
Frankfurt
Thanks for the script - this is indeed a bug which happens when you trade always long and never short. The factors are then wrong. This will be fixed in the next update.

Re: Incorrect OptimalF [Re: jcl] #441377
05/20/14 14:14
05/20/14 14:14
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
You're welcome. You can imagine, it took some effort to produce it since it is just a black box over here.

Re: Incorrect OptimalF [Re: GPEngine] #441379
05/20/14 15:44
05/20/14 15:44
Joined: Jul 2000
Posts: 28,142
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,142
Frankfurt
Yes, for me also - I have the Zorro source here, but that does not mean that I understand it wink.

Re: Incorrect OptimalF [Re: jcl] #441386
05/21/14 02:42
05/21/14 02:42
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
But you can test the OptF calculation function in isolation, right?

Page 1 of 2 1 2

Moderated by  Petra 

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