Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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