Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 7 1 2 3 4 5 6 7
Re: Pre-Market Volatility [Re: Sundance] #426914
07/31/13 12:40
07/31/13 12:40
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, I would set BarPeriod to 60 here, so 3 pending trades are entered every hour.

Re: Pre-Market Volatility [Re: jcl] #426917
07/31/13 12:51
07/31/13 12:51
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Okay. Thanks. But when he sets BarPeriod to 60 and the TICKS flag and won't use pending orders. Would Zorro open a trade every tick when one of the if clauses would be true?

Re: Pre-Market Volatility [Re: jcl] #426918
07/31/13 12:54
07/31/13 12:54
Joined: Jul 2013
Posts: 75
R
royal Offline OP
Junior Member
royal  Offline OP
Junior Member
R

Joined: Jul 2013
Posts: 75
Thanks for the code jcl laugh I will play around with it a bit and come back when more questions come up (and they'll probably will ;))

Re: Pre-Market Volatility [Re: royal] #426919
07/31/13 12:56
07/31/13 12:56
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
We are all learning royal. (except jcl) :-)

Re: Pre-Market Volatility [Re: Sundance] #426920
07/31/13 12:56
07/31/13 12:56
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I only have the advantage to be no trader. As to answer the question if the TICKS flag would exeute the run function every tick: no, it only increases the accuracy of pending orders and stop/trail/profit exits.

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

Joined: May 2013
Posts: 627
Bonn
Ah. Okay. I read the manual but wasn't sure about this.

Re: Pre-Market Volatility [Re: Sundance] #426928
07/31/13 13:46
07/31/13 13:46
Joined: Jul 2013
Posts: 75
R
royal Offline OP
Junior Member
royal  Offline OP
Junior Member
R

Joined: Jul 2013
Posts: 75
Code:
function run()
{
	BarPeriod = 60;
	set(TICKS|LOGFILE);		
	var Price = priceClose();
	TakeProfit = Price;

	Stop = Price + 50*PIP;

		if (hour() >= 8 && hour() < 9){
			enterShort(1,-15*PIP);
			enterShort(1,-20*PIP);
			enterShort(1,-25*PIP);
			enterLong(1,-15*PIP);
			enterLong(1,-20*PIP);
			enterLong(1,-25*PIP);
		}
}



This is my code now, but the problem is the Stop for the Long Trades.
I tried it with this instead of the single Stop function:

Code:
if (TradeIsShort){
	Stop = Price + 50*PIP;
}
else if (TradeIsLong){
	Stop = Price - 50*PIP;
}



but this seems not to work frown

Re: Pre-Market Volatility [Re: royal] #426929
07/31/13 13:49
07/31/13 13:49

A
acidburn
Unregistered
acidburn
Unregistered
A



A common mistake. Remove "Price" from the equation. E.g. Stop = 50 * PIP; That's all that should be needed.

Re: Pre-Market Volatility [Re: ] #426931
07/31/13 13:54
07/31/13 13:54
Joined: Jul 2013
Posts: 75
R
royal Offline OP
Junior Member
royal  Offline OP
Junior Member
R

Joined: Jul 2013
Posts: 75
But I need the Price, as it is the open price and I want the Stop to be 50 Pips +/- from this price and not 50 pips from the price where the trade was entered.

Re: Pre-Market Volatility [Re: royal] #426932
07/31/13 13:59
07/31/13 13:59
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Stop and TakeProfit are relativ to the current price as i know.

The manual says:

enterLong (int Lots, var Entry, var Stop, var TakeProfit, var Trail, var TrailSlope, var TrailLock, var TrailStep): TRADE*

so i don't understand your call of enterLong. Shouldn't it be
enterlong(1,Price,Stop) ?

Page 3 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