Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (3run, Grant, 1 invisible), 3,890 guests, and 16 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
NFA and Virtual Hedging have an effect on training #441128
05/13/14 14:40
05/13/14 14:40
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
In another thread*, you said
NFA and Virtual Hedging are trade execution modes, so they have no effect on training.
If this is true, then how can the output of the following two Strategies be different? The only difference is
In Strategy1, the NFA flag is set only in Test mode
In Strategy2, the NFA flag is set in both Train and Test mode.

Code:
string selected_asset;
function run() {
  BarPeriod = 348;
  LookBack = 279;
  StartDate = 20131020;
  EndDate = 20140420;
  set(RULES + TESTNOW + MUTE);
  if (Train) {
    Hedge = 2;
  } else {
    set(NFA);
    Hedge = 4;
  }
  TradesPerBar = 2;
  ExitTime = 4;
  NumWFOCycles = 3;
  while(selected_asset = loop("CAD/JPY", "CHF/JPY")) {
    asset(selected_asset);
    var atrx = ATR(238);
    TakeProfit = 3 * atrx;
    Stop = 2 * atrx;
    vars Price = series(price());
    var v00 = StdDev(Price, 174);
    if (adviseLong(PERCEPTRON, 0, v00) > 0) {
      enterLong();
    }
    if (adviseShort(PERCEPTRON, 0, v00) > 0) {
      enterShort();
    }
  }
}

(-7218p)

Code:
string selected_asset;
function run() {
  BarPeriod = 348;
  LookBack = 279;
  StartDate = 20131020;
  EndDate = 20140420;
  set(RULES + TESTNOW + MUTE);
  set(NFA);
  if (Train) {
    Hedge = 2;
  } else {
    Hedge = 4;
  }
  TradesPerBar = 2;
  ExitTime = 4;
  NumWFOCycles = 3;
  while(selected_asset = loop("CAD/JPY", "CHF/JPY")) {
    asset(selected_asset);
    var atrx = ATR(238);
    TakeProfit = 3 * atrx;
    Stop = 2 * atrx;
    vars Price = series(price());
    var v00 = StdDev(Price, 174);
    if (adviseLong(PERCEPTRON, 0, v00) > 0) {
      enterLong();
    }
    if (adviseShort(PERCEPTRON, 0, v00) > 0) {
      enterShort();
    }
  }
}

(-8651p)

If NFA flag has no effect on training, how can the outcomes be different?

* Different Result depending on Order of adviseLong / adviceShort

Re: NFA and Virtual Hedging have an effect on training [Re: GPEngine] #441130
05/13/14 15:21
05/13/14 15:21
Joined: Jul 2000
Posts: 28,094
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,094
Frankfurt
Because NFA is consistent with Hedge = 4, but not with Hedge = 2. You can not open short and long trades at the same time when the NFA flag is set.

I admit that this may be confusing. It would be more logical when contradicting NFA and Hedge settings are accepted in training mode. I'll forward this to the developers, maybe this will be changed in a future version.

Re: NFA and Virtual Hedging have an effect on training [Re: jcl] #441150
05/14/14 02:06
05/14/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
Thanks. I'm still not sure I understand.
NFA is not compatible with Hedge=2. So, what happens? Does Hedge get silently assigned some other value?

Re: NFA and Virtual Hedging have an effect on training [Re: GPEngine] #441155
05/14/14 07:57
05/14/14 07:57
Joined: Jul 2000
Posts: 28,094
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,094
Frankfurt
It gets no other value, but I suppose the NFA flag will just prevent hedging even when Hedge=2.

Re: NFA and Virtual Hedging have an effect on training [Re: jcl] #441165
05/14/14 14:56
05/14/14 14:56
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
So NFA flag has effect on training.

Re: NFA and Virtual Hedging have an effect on training [Re: GPEngine] #441168
05/14/14 18:08
05/14/14 18:08
Joined: Jul 2000
Posts: 28,094
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,094
Frankfurt
Apparently yes, when it contradicts the Hedge setting.


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