Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 920 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Workshop - Branches and Loops #478485
10/27/19 02:08
10/27/19 02:08
Joined: Oct 2019
Posts: 6
Canada
E
EvidenceBasedFx Offline OP
Newbie
EvidenceBasedFx  Offline OP
Newbie
E

Joined: Oct 2019
Posts: 6
Canada
from https://manual.zorro-project.com/tutorial_var.htm
Quote
When you click [Test] to run that script, you'll notice that the bottom slider gets the label "Profit".


I ran the code as shown but do not see a label for slider 3. Also, the slider amount looks like it should be limited to the range 50 0-200? However my slider starts at 200 and goes to 29166569.

Is this unexpected? Should I just relax and ignore these quirks? I'm using v. 2.15

Update: Yes I made a mistake with my range expectation - it should be possible to to go down to zero but in fact I cannot do this - see my next post.

Last edited by EvidenceBasedFx; 10/27/19 20:58. Reason: correcting error
Re: Workshop - Branches and Loops [Re: EvidenceBasedFx] #478486
10/27/19 11:08
10/27/19 11:08
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Code
function main()
{
  var profit = slider(3,50,0,200,"Profit",0);
  if(profit > 100)
    printf("Enough!");
  else
    printf("Not enough!");
}
The above code sample works for me.

Also, you are expecting the wrong range. Please read the description of slider() here:
https://manual.zorro-project.com/slider.htm

Re: Workshop - Branches and Loops [Re: EvidenceBasedFx] #478488
10/27/19 20:47
10/27/19 20:47
Joined: Oct 2019
Posts: 6
Canada
E
EvidenceBasedFx Offline OP
Newbie
EvidenceBasedFx  Offline OP
Newbie
E

Joined: Oct 2019
Posts: 6
Canada
Thanks Andrew - when you say it works do you see the slider label named 'profit'? I should mention that the script basically 'works' apart from the quirks of missing label and profit slider with unexpected values behaviour (more detail below).

The documentation seems to confirm that I am expecting the correct range.

Parameters are 3,50,0,200,"Profit",0
3 - slider 3
50-initial slider value
0 - minimum slider value
200 - maximum slider value ->Not being enforced - unless I just don't understand how sliders are meant to work. I would expect that by sliding this all the way to the right that values would increase from 0 to 200. What happens is the test begins at 50, and after touching the slider the value adjusts to 200 and can be increased beyond that. However it is no longer possible to reduce the value below 200 with the slider unless the test is reset. That seems like a bug.
name - expecting "Profit" instead I see "Slider 3"
0 - no tooltip

Last edited by EvidenceBasedFx; 10/27/19 20:55. Reason: clarity
Re: Workshop - Branches and Loops [Re: EvidenceBasedFx] #478490
10/27/19 21:04
10/27/19 21:04
Joined: Oct 2019
Posts: 6
Canada
E
EvidenceBasedFx Offline OP
Newbie
EvidenceBasedFx  Offline OP
Newbie
E

Joined: Oct 2019
Posts: 6
Canada
Ok, the bug is mine because the investment calculator works and when I copy&paste your code it also works. I was missing a parameter value is the problem. Sorry for wasting your time! I wish I could say it will be the last time but I doubt it.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1