i try to modify the script in this mode
int isPositionOpen = 0; // Variabile per tenere traccia dello stato della posizione

function run()
{
set(PARAMETERS+LOGFILE);
BarPeriod = 60;


if(day() == MONDAY && hour() == 23 )

{
// Calcola l'RSI a 2 periodi
vars Price = series(price());
vars RSI2 = series(RSI(Price, 2));

if(RSI2[0] < 30 && !isPositionOpen)
{
enterLong(1);
isPositionOpen = 1; // Imposta lo stato della posizione su aperta
printf("Entered long position");
}
}

if(day() == WEDNESDAY && hour() == 0 && isPositionOpen)
{
exitLong(1);
isPositionOpen = 0; // Imposta lo stato della posizione su chiusa
printf("Exited long position");
}
}

but nothing not close in WEDNESDAY :(((