Error code when made simple change to 7 c tutorial

Posted By: trader18

Error code when made simple change to 7 c tutorial - 08/17/16 12:24

Hello,

I tried making a simple change to the code in workshop 7.c.
I changed the BarPeriod from:

BarPeriod = 1440; // 1 day

to:

BarPeriod = 60; // 1 hour

The system crashed with error 039 "expression too long"

What have I done wrong?





function run()
{
StartDate = 2005;
EndDate = 2015;
BarPeriod = 1440; // 1 day
Posted By: jcl

Re: Error code when made simple change to 7 c tutorial - 08/17/16 14:58

You need the FAST flag for this. The rule became too complex for being converted to a function.
Posted By: trader18

Re: Error code when made simple change to 7 c tutorial - 08/18/16 02:38

I added FAST below with the same error.
Do you have an example please.
Thanks

function run()
{



StartDate = 2005;
EndDate = 2015;
BarPeriod = 60; // 1 day
BarZone = WET; // Western European midnight
Weekend = 1; // don't merge Friday and Sunday bars
LookBack = 3; // only 3 bars needed
NumWFOCycles = 10;

set(RULES+TESTNOW+FAST);
Posted By: jcl

Re: Error code when made simple change to 7 c tutorial - 08/18/16 09:16

Look in the manual under "adviseLong" about how to use the FAST flag for candle patterns. Generally, make the manual "Search" function your friend - all the issues that you have are easily solved by finding the right place in the manual.

For converting the script to 1-hour bars, some more things have to be considered besides just changing the bar period. You can find a script version for 1-hour bars on the Financial Hacker page, under "Better tests with oversampling".
Posted By: trader18

Re: Error code when made simple change to 7 c tutorial - 08/18/16 11:52

Thanks jcl. I will try and learn that process.

As a newcomer, my first take on "zorro" is that it is a "black box" type system. That may be because I do not know where to look things up, it may be because it is not week documented or it may be because the architects want to keep you in the dark.

Not sure yet. It almost reminds me at this point of programming a FIX API to a broker that has few examples.

Just an observation.

My next question is where to get more of this knowledge. I will try the searching function in the manual. Perhaps that will help (although hardly efficient). What about subscribing to the "ticket" service. That service said that they do not fix code nor provide examples? What is the "service" then, not sure.

I also noticed there was a "German" version of the documentation that was supposedly better written and more in depth. Is there a transalation? Is this meant more for the "German" market that the "English" market?

One of the reasons I love to program in Python (even though it is slow a molasses, is that I can verify everything myself, tons of libraries and tons of ways to verify the calculations)

Anyway, I have rambled enough. Perhaps this info will help the next guy
Posted By: trader18

Re: Error code when made simple change to 7 c tutorial - 08/18/16 11:52

should have said not "well documented", oops
Posted By: AlexHorn

Re: Error code when made simple change to 7 c tutorial - 08/19/16 21:40

Oh, thatīs nice (for German speakers at least). Could you share the link for the German documentation please?
Posted By: dr_panther

Re: Error code when made simple change to 7 c tutorial - 08/28/16 14:13

Iīm also interessted in the German documenation
Posted By: Sphin

Re: Error code when made simple change to 7 c tutorial - 08/28/16 17:09

Although I thought the same way when I started interessting in algorhithmic trading - the other way around is IMO the better one because really a lot of serious books, articles and other readings are in English and a lot of people with interessting opinions publish them in this language. So I think it's more sensful to learn the vocabulary to understand the docs in their original writing, you can use it later many times!
© 2024 lite-C Forums