Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, Ayumi, 7th_zorro), 877 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help all #471125
02/20/18 08:00
02/20/18 08:00
Joined: Dec 2017
Posts: 42
Mongolia
T
Tuguldur717 Offline OP
Newbie
Tuguldur717  Offline OP
Newbie
T

Joined: Dec 2017
Posts: 42
Mongolia
Hellow all i do not understand this code. After execution "i" took 129 value. I think "i" must take value of 24. What happening to me can you explain it?

var i=0;
function run(){
Barperiod=60;
StartDate=20170201;
EndDate=20170202;
i=i+1;
printf("Result=%.f",i);
}

Re: Help all [Re: Tuguldur717] #471135
02/20/18 12:17
02/20/18 12:17
Joined: Aug 2017
Posts: 102
Spain
B
Brax Offline
Member
Brax  Offline
Member
B

Joined: Aug 2017
Posts: 102
Spain
Use this:

Code:
static var i = 0;

function run()
{
    LookBack = 0;
    BarPeriod = 60;
    StartDate = 20170201;
    EndDate = 20170201;

    i++;
    if(is(EXITRUN))
        printf("Result=%.f", i);
}



The key is "LookBack = 0;", when unspecified Zorro assumes a default value and it always execute before the lookback bars before processing the rest.

Re: Help all [Re: Brax] #471137
02/20/18 12:39
02/20/18 12:39
Joined: Dec 2017
Posts: 42
Mongolia
T
Tuguldur717 Offline OP
Newbie
Tuguldur717  Offline OP
Newbie
T

Joined: Dec 2017
Posts: 42
Mongolia
WOOOW wonderful it works perfect. thank you again brax. Hahahaha

Re: Help all [Re: Brax] #471138
02/20/18 12:46
02/20/18 12:46
Joined: Dec 2017
Posts: 42
Mongolia
T
Tuguldur717 Offline OP
Newbie
Tuguldur717  Offline OP
Newbie
T

Joined: Dec 2017
Posts: 42
Mongolia
Brax could i ask about zorro code further? If you do not hesitate how can i contact you directly?

Re: Help all [Re: Tuguldur717] #471154
02/20/18 21:31
02/20/18 21:31
Joined: Aug 2017
Posts: 102
Spain
B
Brax Offline
Member
Brax  Offline
Member
B

Joined: Aug 2017
Posts: 102
Spain
I don't mind helping others if i have the time and knowledge, but i'd rather prefer to keep using the forum as usual.

I suggest you reading the manual completely and learn the basics about programming and algo trading. Many of your questions are simple and can be found there.

Just try to make your questions precise and in one post per time, i am sure this way more people will be able to help you.

Hope you understand.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1