Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, TipmyPip, VoroneTZ, Quad, 1 invisible), 688 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 7 1 2 3 4 5 6 7
Re: Pre-Market Volatility [Re: Sundance] #426953
07/31/13 15:30
07/31/13 15:30
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
enterLong is not an overloaded function, it's a function with a variable number of arguments. The arguments not needed can be omitted - and, I almost don't dare to say, this is described in the manual.

Re: Pre-Market Volatility [Re: jcl] #426982
07/31/13 20:21
07/31/13 20:21
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Don't dare.
...too late...

But i don't get it.
The manual has an example: enterLong(0,Price,0,Grid)

So you have the lots, the entry price,the stop and the take profit as parameters.
How can we now call enterLong(1,-15*PIP) ??
What does that mean? When enterLong is not an overloaded function then -15*PIP is the entry price?
So in the background Zorro 'knows' when you give it a price or give it a relative pip value?
So when you talk about price it can be the absolute price or pip-distance!?

Re: Pre-Market Volatility [Re: Sundance] #427009
08/01/13 08:42
08/01/13 08:42
Joined: May 2013
Posts: 245
S
swingtraderkk Offline
Member
swingtraderkk  Offline
Member
S

Joined: May 2013
Posts: 245
@royal

Does the original strategy intend that pending long and short orders are hit within the hour, or does it intend that only long or only short orders are hit? If the latter then you need a function to cancel the pending opposite orders if one is hit. I think you will need a trade management function for that as it will have to be executed at each tick and cannot be done at the end of each hour.

I also think that you need a TimeWait = 1; so that the pending orders don't hang around forever and are only entered between 8 & 9.

Also what 8 o'clock do you want the strategy to run is it 8am CET,GMT,UTC?

@jcl

For clarification:

When you set Barperiod = 60 does that default to ending the bars at 00 minutes 00 seconds or does this need to be explicitly specified?

The manual states that:

Code:
hour (int offset): int
Closing UTC hour of the given bar, 0..23. hour(0) gives the current hour and can be used to apply different trade tactics in the New York, European, or Asia-Pacific session.



so hour(0) gives the current closing hour in UTC, so at a few milliseconds past 8am (when zorro runs after the close of the 7am - 8am bar) does this return 9 as the closing hour (end of the bar just started at 8am) or 8 as the closing hour of the bar just finished bar 0, that started at 7am but closed at 8?

Does hour() return the same as hour(0)?

Re: Pre-Market Volatility [Re: swingtraderkk] #427022
08/01/13 10:10
08/01/13 10:10
Joined: Jul 2013
Posts: 75
R
royal Offline OP
Junior Member
royal  Offline OP
Junior Member
R

Joined: Jul 2013
Posts: 75
Quote:
Does the original strategy intend that pending long and short orders are hit within the hour, or does it intend that only long or only short orders are hit? If the latter then you need a function to cancel the pending opposite orders if one is hit. I think you will need a trade management function for that as it will have to be executed at each tick and cannot be done at the end of each hour.


Afaik only one direction should be traded, this is missing in the code. Also the entries and stoploss should not be fixed at 15,20,25 / 50 but pending on the 8-9 o'clock volatility of the last 22 trading days.

Quote:
I also think that you need a TimeWait = 1; so that the pending orders don't hang around forever and are only entered between 8 & 9.


The pending orders are cancelled after 9 o'clock, this is working as I see in the Logfile.

Quote:
Also what 8 o'clock do you want the strategy to run is it 8am CET,GMT,UTC?


It's 8 o'clock German time, so CET i think

Re: Pre-Market Volatility [Re: royal] #427024
08/01/13 10:19
08/01/13 10:19
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
8am-9am Frankfurt time would be UTC 06:00-07:00 I believe.
I use this site: http://www.timeanddate.com/worldclock/meeting.html

Re: Pre-Market Volatility [Re: dusktrader] #427026
08/01/13 10:36
08/01/13 10:36
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Prices such as entry, stop, etc. can be given either as a distance, or as an absolute price. Zorro knows what is meant. -> http://manual.zorro-trader.com/stop.htm

hour(0) is the same as hour(). It's the closing time of the current bar, and also the current time at the moment when the script is executed. The start time of the current bar would be hour(1).

Re: Pre-Market Volatility [Re: jcl] #427030
08/01/13 10:54
08/01/13 10:54
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
I found it in the manual. You are right. And i really looked at it bevore... :-(

-------------------------------
'Either an (absolute) price, or a (relative) distance to the trade opening price (TradePriceOpen) can be used for Stop, TakeProfit, Trail, and Entry.'
--------------------------------

Re: Pre-Market Volatility [Re: Sundance] #427032
08/01/13 11:56
08/01/13 11:56
Joined: May 2013
Posts: 245
S
swingtraderkk Offline
Member
swingtraderkk  Offline
Member
S

Joined: May 2013
Posts: 245
Code:
hour(0) is the same as hour(). It's the closing time of the current bar, and also the current time at the moment when the script is executed. The start time of the current bar would be hour(1).



Sorry jcl the limited brain is still confused.

In this example, we want the script to execute at some microseconds past 06:00 UTC. The current time when the script executes is not the same as the current bar, my understanding is that the current bar is bar zero, i.e. the most recently fully completed bar.

In the rest of zorro, bar number 0 is the bar just closed i.e. 05:00:00 to 06:00:00, so is the closing time of bar 0 = 06:00:00 and hour(0)=6?

However, where I get confused is because the current time the script is running is now in a new bar not fully formed you could say bar -1, running from 06:00:00 to 07:00:00, in that case the closing time of the bar the script is running in is 07:00:00 and should hour()=7?

So for our current script example is the correct statement to allow for daylight saving:

Code:
if (lhour(CET,0) == 8 or 9)






Last edited by swingtraderkk; 08/01/13 11:56.
Re: Pre-Market Volatility [Re: swingtraderkk] #427038
08/01/13 12:15
08/01/13 12:15
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Bar Zero is not completed. You have an open price and a current price. The close price will be the same value as the current price. It is the bar you referred to as -1 bar. AFAIK ...

Re: Pre-Market Volatility [Re: Sundance] #427039
08/01/13 12:47
08/01/13 12:47
Joined: May 2013
Posts: 245
S
swingtraderkk Offline
Member
swingtraderkk  Offline
Member
S

Joined: May 2013
Posts: 245
In this thread jcl indicates that price(0) is from the bar just closed.

This raises another question though, when writing a trade management function, that will be executed on ticks in a new bar forming, is there a difference between price() and price(0)?

This was easier to get my head around in metatrader where the scripts ran on each tick and the last completed bar was 1 and anything in the current bar was 0.

Zorro may function like metatrader in the functions that execute at a tick level, but normally the scripts execute immediately after a barperiod closes and I suppose theoretically before anything happens in the new barperiod that would need reference to.

Last edited by swingtraderkk; 08/01/13 12:56.
Page 5 of 7 1 2 3 4 5 6 7

Moderated by  Petra 

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