Thanks all. That is the code:
#define D1 (1440/BarPeriod)//
#define W1 (7200/BarPeriod)//
#define MN1 (30240/BarPeriod)//

Stop = 4*ATR(100);
Trail = 4*ATR(100);
LookBack = 100;
BarPeriod = 60;//
Hedge = 1;
TimeFrame = D1;
vars PriceD1 = series(price());//
TimeFrame = W1;
vars PriceW1 = series(price());
TimeFrame = MN1;
vars PriceMN1 = series(price());

void direzioneLong()
{
if (PriceD1[0]>PriceD1[1])
enterLong();
}

void direzioneShort()
{
if (PriceD1[0]>PriceD1[1])
enterShort();
}
int run()
{

if (PriceMN1[0]>PriceMN1[1] and PriceW1[0]>PriceW1[1] and PriceD1[0]<PriceD1[1])
direzioneLong();
if (PriceMN1[0]<PriceMN1[1] and PriceW1[0]<PriceW1[1] and PriceD1[0]>PriceD1[1])
direzioneShort();
}