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
1 registered members (Quad), 3,042 guests, and 14 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Lot Size and Portfolio Performance #475954
01/15/19 13:47
01/15/19 13:47
Joined: Oct 2018
Posts: 70
AZ
C
chsmac85 Offline OP
Junior Member
chsmac85  Offline OP
Junior Member
C

Joined: Oct 2018
Posts: 70
AZ
I used the script the Jrath edited and I have a new source of confusion.

If I change Lots from 1000 to 500, I expected the AR to be fixed. However, the sign on the AR changed from positive to negative. What is the impact of Lot Size on the enterLong/enterShort functions?

I'm guessing that has to be the source of the variance.

Do I need to define each of the parameters in order to get a the expected behavior of AR being fixed by only changing the Lots parameter?

Code:
function run()
{
  Lots = 1000;
  vars Close = series(priceClose());
  vars SMA200 = series(SMA(Close,200));
  vars SMA20 = series(SMA(Close,20));
  vars Price_diff200 = series(abs((*Close - *SMA200)/ (*Close))  * 100.0);
  

  
  if(*Price_diff200 > 2.0)
	  if(SMA20 < SMA200)
		  enterLong();
      else if(SMA20 > SMA200)
			enterShort();
}


Last edited by chsmac85; 01/15/19 13:47.
Re: Lot Size and Portfolio Performance [Re: chsmac85] #475955
01/15/19 13:54
01/15/19 13:54
Joined: Oct 2018
Posts: 70
AZ
C
chsmac85 Offline OP
Junior Member
chsmac85  Offline OP
Junior Member
C

Joined: Oct 2018
Posts: 70
AZ
Updating my previous post. If I am interpreting the resulting output picture correctly (attached), all trades are not closed until the very last bar.

Attached Files result.png

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1