Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (alibaba, howardR, basik85278), 756 guests, and 3 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
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: 17
J
jari Offline OP
Newbie
jari  Offline OP
Newbie
J

Joined: Jan 2021
Posts: 17
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: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
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: 17
J
jari Offline OP
Newbie
jari  Offline OP
Newbie
J

Joined: Jan 2021
Posts: 17
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