Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,631 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: TMF questions [Re: DMB] #432515
11/07/13 09:04
11/07/13 09:04
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
I admit that I still do not fully understand any of your problems.

It is irrelevant if you use elements of a series, or separate variables with the same content. Variables that have the same value always behave the same way. A different name or origin of the variable will not make an "if statement work better". An if statement does not care where the variables come from that it compares.

An entry stop does not enter at the given price. You can not choose the price at which you enter a trade. You can only choose the time. When you have a current price of 10 Dollars and place a short order with an entry stop of 15 Dollars, your order will at once open at 10 Dollars, no matter how high you placed the entry stop. At least that's how I understand your problem. The concept of entry stops and limits is explained on many websites.

The order of function definitions in a script is also irrelevant. All this is not the reason when your script does not behave as you want. If you can not find the problem by looking at your script, definitely use a printf statement that prints _all_ variables in question. This gives you often a lot more direct insight than a line on a chart.

Re: TMF questions [Re: jcl] #432517
11/07/13 09:23
11/07/13 09:23
Joined: Aug 2013
Posts: 124
D
DMB Offline OP
Member
DMB  Offline OP
Member
D

Joined: Aug 2013
Posts: 124
JCL - you are totally correct on the variables and the IF statement. I was confused by the unexpected behaviour of the enterShort() function. I apologise for rambling on about it.

On the correct use of enterShort - suppose the current price is 10 and I want to go short at 15 if the market touches 15, and 15 is determined as the variable Dot11High. Do I include the condition that (priceClose() == Dot11High) in the IF statement?

Thus this will be evaluated on each tick and once the condition is met, the trade is entered and the condition is no longer evaluated on this bar(?)

EDIT: corrected priceClose().

Last edited by DMB; 11/07/13 09:27.
Re: TMF questions [Re: DMB] #432519
11/07/13 09:40
11/07/13 09:40
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
The run() function runs every bar, not every tick, so it can not be used for determining when the market touches a price. For your method you need indeed an entry order, but an entry limit, not an entry stop. An entry limit enters short when the price goes up, an entry stop enters when it goes down.


Re: TMF questions [Re: jcl] #432520
11/07/13 09:59
11/07/13 09:59
Joined: Aug 2013
Posts: 124
D
DMB Offline OP
Member
DMB  Offline OP
Member
D

Joined: Aug 2013
Posts: 124
Thanks!!! Now it is behaving exactly as expected. It was the missing negation of the entry price that was messing everything up. Case closed!

Page 2 of 2 1 2

Moderated by  Petra 

Gamestudio download | 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