Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Nymphodora, AndrewAMD, TipmyPip, Quad, Imhotep), 847 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Slider #470709
01/31/18 23:02
01/31/18 23:02
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Manual says on the Slider's page the following:
Quote:
The sliders jump to their default positions (pos parameter) when the script is started the first time, or when [Script], [Asset], or [Edit] was clicked. Otherwise the sliders keep their previous position. For testing a script with a certain slider position, click [Test], wait until the sliders appear, then click [Stop], put the sliders to the desired position and click [Test] again. In [Trade] mode the sliders are stored in the .trd file and thus always 'remember' their last position.


It seems that this part isn't true anymore:
Quote:
or when [Script], [Asset], or [Edit] was clicked



This part is a bit inaccurate:
Quote:
For testing a script with a certain slider position, click [Test], wait until the sliders appear, then click [Stop], put the sliders to the desired position and click [Test] again.

It isn't enough to simply wait until the sliders appear. One should wait until the INITRUN is over and "Test: <script name>" message appears.

When it comes to the Trade mode, the logic is different and .trd file is used as mentioned in the manual. But what happens during the first run of a strategy when there is no trd file? According to my observations, when running a script for the first time in the Trade mode a desired slider position could be set using 2 options:
  • 1st option: Start Test. Wait until INITRUN is over and "Test: ..." message is shown. Stop it. Set the slider. Then Trade a script. The slider won't be overwritten by the default value.
  • 2nd option. Run a script with the default slider in the Trade mode. Simply change the slider while running in the Trade mode.

Re: Slider [Re: kujo] #470712
02/01/18 10:27
02/01/18 10:27
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
You can move a slider as soon as it appears. This happens in the INITRUN when the slider name is assigned.

Re: Slider [Re: jcl] #470716
02/01/18 11:14
02/01/18 11:14
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Quote:
You can move a slider as soon as it appears.

Indeed, if you move it during run without hitting Stop. However, if you click Stop it's a different story. See below


Quote:
For testing a script with a certain slider position, click [Test], wait until the sliders appear, then click [Stop], put the sliders to the desired position and click [Test] again.


I've tried this with my script and logged every step. It doesn't work if I click Stop immediately after the slider appear. I change the slider but after I reTest a script the slider returns back. Above mentioned condition isn't enough. One should wait a bit longer and then hit Stop.

Last edited by kujo; 02/01/18 11:30.
Re: Slider [Re: kujo] #470789
02/06/18 16:20
02/06/18 16:20
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Aside from above-mentioned there is one more question
Quote:
If the script needs to be recompiled, or if it contains any global or static variables that must be reset, click [Edit] before [Test]. This also resets the sliders to their default values. Otherwise the static and global variables and the sliders keep their settings from the previous test run.


Clicking Edit doesn't work as stated. So, what's the legit method to reset sliders and variables now? Should I click Edit and then Run in N++ to start a new instance of Zorro?

Last edited by kujo; 02/06/18 16:24.
Re: Slider [Re: kujo] #470802
02/07/18 10:53
02/07/18 10:53
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
To recompile and reset sliders and variables, click [Edit], then [Test]. Or click on the script scrollbox and select the script again. What did not work?

Re: Slider [Re: jcl] #470818
02/07/18 15:48
02/07/18 15:48
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Originally Posted By: jcl
To recompile and reset sliders and variables, click [Edit], then [Test]. Or click on the script scrollbox and select the script again. What did not work?


Oh, shoot! It does work. Sorry for confusion!

The only thing that doesn't work is:
Quote:
For testing a script with a certain slider position, click [Test], wait until the slider names appear, then click [Stop], put the sliders to the desired position and click [Test] again.


Try this:
- Start Zorro
- Select Z3
- Click Test and immediately after the sliders names appear click Stop
- Change Capital to 2100
- Click Test
- Capital is back to 2000

I just want to say that it's not enough to wait until sliders names appear, you should wait a little bit longer. That's it laugh

Re: Slider [Re: kujo] #470819
02/07/18 15:57
02/07/18 15:57
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Ah, ok. I'll check where this additional little bit time comes from. Possibly still some initialization, such as asset loading.

Re: Slider [Re: kujo] #479990
05/11/20 16:45
05/11/20 16:45
Joined: Feb 2016
Posts: 15
Milan, Italy
F
fsgi Offline
Newbie
fsgi  Offline
Newbie
F

Joined: Feb 2016
Posts: 15
Milan, Italy
"Blast from the past" here.

Thank you for the nice discussion and...

Is there a way (any one!) for REALLY resetting a slider to a programatically chosen "position" (value) at script start-up, without using the value that is left there from the last run of the same script?

Thank you for the help and the patience.

Re: Slider [Re: kujo] #479999
05/12/20 09:37
05/12/20 09:37
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
The sliders are reset to default when the script is changed or "Edit" is clicked. Otherwise call slider(N,Pos) to set them to a defined position.

Re: Slider [Re: kujo] #480001
05/12/20 15:55
05/12/20 15:55
Joined: Feb 2016
Posts: 15
Milan, Italy
F
fsgi Offline
Newbie
fsgi  Offline
Newbie
F

Joined: Feb 2016
Posts: 15
Milan, Italy
Dear jcl,

this seems not to work as expected.

If I for instance code something like this:
Code
void main()
{
	slider(1, 0, 0, 100, "Test");
	slider(1, 0); //it should be useless
	printf("\nSlider value: %i", slider(1));
	int slider_output = 0;
	int count = 0;
	while(slider_output == 0)
	{
		if(count % 100 == 0)
		{
			printf("\n### Change value of slider 1 ###");
		}
		wait(1000);
		slider_output = slider(1);
		count++;
	}
	printf("\nnow slider has value: %i", slider_output);
	quit();
}


... when I run it , it produces a nice output:
Code
Slider value: 0
### Change value of slider 1 ###
now slider has value: 3
Quit


But then, as soon as I re-run the script without recompiling/shutting down Zorro/changing scritp, without touching ANYTHING (e.g. not shifting the slider back in the GUI), I still obtain

Code
Slider value: 0
### Change value of slider 1 ###
now slider has value: 3
Quit


...meaning that the GUI "fixed" slider is not reset programmatically and that it overwrites (or immediately changes back the programmatically-set slider value) to its position...

This was what I meant.

Page 1 of 2 1 2

Moderated by  aztec, Inestical, Matt_Coles, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1