Well I don't know if this is really telling why it writes two files.
Like I mentioned, both get updated.

Just one seems to be empty -> size really small, while the other is bigger.
Also I don't know the basic structure of the scripts of Grat.


function run()
{
//set(EXE);
brokerCommand(SET_PATCH,8);
brokerCommand(SET_WAIT,30000);
setf(PlotMode, PL_ALL+PL_FINE);
set(PLOTNOW, PRELOAD);//, LOGFILE
set(FACTORS+PARAMETERS);
NumTrainCycles = 2;
BarMode = BR_SLEEP;
BarPeriod = 1440;
BarZone = ET;
ReTrainDays = 7;
TrainMode = ASCENT;
StopFactor = 1.5;
NumCores = -1;
//StartDate = ymd(wdate(NOW) - 720);
//EndDate = 20200801;
//UnstablePeriod = 12;
LookBack = 12;
MonteCarlo = 0; // 0 saves time at the end of the simulation
EndWeek = 52155;
if(Train){
OptimalFRatio = 2.5;
Hedge = 2;
}else{
Hedge = 5;}

MaxLong = MaxShort = 3;

SaveMode = SV_SLIDERS+SV_ALGOVARS+SV_TRADES+SV_STATS+SV_BACKUP;
total_usd_exposure = slider(1, 0, 0, 1000000, "USDx1k", "Total USD exposure per long/short position")*1000;
if(is(FIRSTINITRUN))
assetList("P:\\AssetsCur3.csv");

if(is(INITRUN) and !is(TRAINMODE))
{
// set USD exposure
int slider_output = slider(1);
int count = 0;
while(slider_output == 0)
{
if(count%100 == 0)
{
printf("\n### SET UP USD EXPOSURE WITH SLIDER ###");
}
wait(100);
slider_output = slider(1);
count++;
}
}else{
int slider_output = 1;
}

// portfolio loop
while(asset(loop(Assets))){
if(assetType(Asset) != FOREX)
continue; // Currency pairs only 30 total
UpdateDays = -1;
if(is(TRADEMODE)) printf("\nActual Spread for %s is %.2f", Asset, Spread/PIP);
lots_from_usd_exposure();
while(algo(loop("Range:L","Range:S")))
{
NumComponents = NumLoops1*NumLoops2;
switch(Algo) {
case "Range:L": Range(); break;
case "Range:S": Range(); break;
}
}
}
if(Init) printf("\n%i components",NumComponents);
}

Last edited by danatrader; 10/24/20 14:31.