Hi Everyone,

Currently trying to build out my first Zorro strategy and settled on developing a pairs trading strategy pitting Aussie Dollar (Y) against gold (X).

I am trying to allocate weighted position size to the Gold based on the ratio of the average true range of Y to X. I have also set the Capital to 100,000 and RiskAllocation to 10000.


Code
	  if(NumOpenTotal < maxOpen)  {
        if(crossUnder(stocNorm, lowerThreshold)) // buying the spread (long Y, short X)
        {
	 asset(Y);
            Risk = RiskAllocation;
            enterLong();
            asset(X);
	    Risk = RiskAllocation *(AtrY/AtrX);
            enterShort();
        }
        if(crossOver(stocNorm, upperThreshold)) // shorting the spread (short Y, long X)
        {
           asset(Y);
            Risk = RiskAllocation;
            enterShort();
            asset(X);
	   Risk = RiskAllocation *(AtrY/AtrX);
            enterLong();
        }
     }


At first i thought it was because capital was too small, but even making a 100 million and Risk = 100k the log still show only one lot per pair.

Code
[126: Fri 10-02-05 15:40] 10000074 0 10/6  (1061.10)
[127: Mon 10-02-08 15:40] 10000074 0 10/6  (1066.16)
[128: Tue 10-02-09 15:40] 10000074 0 10/6  (1075.11)
[129: Wed 10-02-10 15:40] 10000074 0 10/6  (1066.41)
[AUD/USD::L12902] Long 1@0.872119  at 15:40:00
[XAU/USD::S12903] Short 1@1066.77  at 15:40:00



Any suggestion, comments or feedback would be most appreciated.