Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by jcl. 04/20/24 08:52
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (7th_zorro, Aku_Aku, henrybane, flink, 1 invisible), 712 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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