Gamestudio Links
Zorro Links
Newest Posts
Alternative to Stooq for Zorro S
by cwford. 10/09/26 21:13
Stooq now requires an API key
by cwford. 10/08/26 23:27
ZorroGPT
by TipmyPip. 10/06/26 05:32
Purchase A8 full licence version
by jcl. 10/05/26 12:12
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (AndrewAMD, Quad), 23,826 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 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: 601
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 601
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