So what is the profit/loss since you have started running it?

My live demo has suffered from several technical failures (the first was the bar offset problem and the second was that huge oil loss from incorrect contract allocation by FXCM). Both of these problems have steered me away from trading it for real.

I also have a problem with the Oil contract size being different from what the broker has. For instance on Friday it went short 780 contracts instead of 78. I can change this in assetsfix but this file is downloaded from the broker when it connects, effectively overriding my changes?

On a topic more closely related to the strategy, I was listening to a trading podcast where the subject was seasonality it equity markets. The speaker claimed that are a lot of automatic purchases of US equities within the last 4 days of the trading month and between the first 3 trading days of the next month. Consequently he claimed that there was an edge in buying in the last 4 days of the month and selling within the next 3 days of the next month.

Naturally I thought to test this idea with Zorro on the SPX500. This is long only obviously. My version simply buys on the 18th trading day of the month and sells on the 3rd day of the next month. I was thinking to add this to the ONS system.

-----------------------------------------------------
//Jay Kaeppel Last 4, first 3 trading days of the S&P500

#include <profile.c>

function run(){
// UpdateDays = -1;
set(PARAMETERS+FACTORS);
Verbose = 14;
// Detrend = TRADES;
// Capital = 2000;
// Margin = OptimalFLong * Capital * sqrt(1 + max(0,WinTotal-LossTotal)/Capital);
BarPeriod = 1440;
StartDate = 2005;
// NumWFOCycles = 5;
asset("SPX500");
var OptimalStop = optimize(50,50,500,50) * PIP;

if(tdm(0) == 18) //optimize(1,1,23,1))
enterLong(0,0,OptimalStop, 0); // stop loss
if(tdm(0) == 3) //optimize(1,1,23,1))
exitLong();

plotMonthProfit();

}