Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Stop is set but enterLong() sets a very different stop level #486887
11/07/22 15:12
11/07/22 15:12
Joined: Jan 2021
Posts: 19
J
jari Offline OP
Newbie
jari  Offline OP
Newbie
J

Joined: Jan 2021
Posts: 19
I did this in run():
Code
#define INFINITY_SUBST 1000

function run() {
	.
	.
	.
	Margin = slider(1,2000,100,10000,"Margin Allocated");
	Stop = price(0) / INFINITY_SUBST;
	Risk = Margin / 200.0;
}


When I did a print of Stop and then do enterLong(), log says:
Code
Stop 0.00000002

[xxxxxx::L00101] Long x@0.000019520 Risk 0  at xx:xx:xx
Stop 0.000019500


Why is the 0.00000002 Stop not honoured when enterLong happens?
(basically I want the stop to be practically 0 and let Risk determine the lot size)

Thank you!!

Re: Stop is set but enterLong() sets a very different stop level [Re: jari] #486894
11/08/22 09:51
11/08/22 09:51
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
Your 0.00000002 is a stop distance, not a stop level.

https://zorro-project.com/manual/en/stop.htm

Re: Stop is set but enterLong() sets a very different stop level [Re: Petra] #486898
11/08/22 13:34
11/08/22 13:34
Joined: Jan 2021
Posts: 19
J
jari Offline OP
Newbie
jari  Offline OP
Newbie
J

Joined: Jan 2021
Posts: 19
Hmm just realised that, for Stop, "If the value is less than half the asset price, Zorro assumes that it's a distance, otherwise it's a price level"
i.e. the stop level can't be more than half of asset price

Ref: https://zorro-project.com/manual/en/stop.htm


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1