Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,008 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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