Posted By: forexcoder
Error 111 - Crash in Script - 03/20/15 13:34
Hi everyone.
What kind of error is this?
Posted By: yosoytrader
Re: Error 111 - Crash in Script - 03/20/15 13:38
maybe an error in the script coding, can you post the script?
Posted By: MatPed
Re: Error 111 - Crash in Script - 03/20/15 14:46
One of the worst thing, because dubugging in Zorro is "old-style" this have helped me:
http://zorro-trader.com/manual/
Posted By: forexcoder
Re: Error 111 - Crash in Script - 03/21/15 11:12
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();
}
Posted By: yosoytrader
Re: Error 111 - Crash in Script - 03/21/15 12:33
Hi forexcoder, I defined the vars arrays as global - outside the run() - and initialized inside the run()
Moreover I get error because of not enough bars to compute the ATR.
Why not use the script skeletons taught in the workshops?
Hope this helps.
#define D1 (1440/BarPeriod)//
#define W1 (7200/BarPeriod)//
#define MN1 (30240/BarPeriod)//
vars PriceD1;
vars PriceW1;
vars PriceMN1;
void direzioneLong()
{
if (PriceD1[0]>PriceD1[1])
enterLong();
}
void direzioneShort()
{
if (PriceD1[0]>PriceD1[1])
enterShort();
}
void run()
{
LookBack = 100;
BarPeriod = 60;
Hedge = 1;
TimeFrame = D1;
PriceD1 = series(price());
TimeFrame = W1;
PriceW1 = series(price());
TimeFrame = MN1;
PriceMN1 = series(price());
Stop = 4*ATR(100);
Trail = 4*ATR(100);
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();
}
Posted By: forexcoder
Re: Error 111 - Crash in Script - 03/22/15 11:00
Thanks very much yosoytrader.