Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,430 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 5 1 2 3 4 5
Re: Luxor system - Jaekle and Tomasini [Re: RTG] #439637
04/06/14 11:52
04/06/14 11:52
Joined: Jul 2013
Posts: 75
R
royal Offline
Junior Member
royal  Offline
Junior Member
R

Joined: Jul 2013
Posts: 75
Take a look at manual part Trading -> optimize
There you can see how the optimize function is used, for example like this one:

Code:
vars Price = series(price(0));
var TimeCycle = optimize(30,10,100,5,0);
vars MA1 = series(SMA(Price,TimeCycle));


Last edited by royal; 04/06/14 11:55.
Re: Luxor system - Jaekle and Tomasini [Re: jcl] #450189
04/08/15 12:21
04/08/15 12:21
Joined: Feb 2015
Posts: 45
Italy
forexcoder Offline
Newbie
forexcoder  Offline
Newbie

Joined: Feb 2015
Posts: 45
Italy
Originally Posted By: jcl

Code:
function run()
{
	StartDate = 20021021;
	EndDate = 20080704;
	BarPeriod = 30;
	LookBack = 30;
	set(TICKS|PLOTNOW);
	PlotWidth = 800;

	asset("GBP/USD");

// no commissions...	
	Spread = 0;
	Slippage = 0;
	RollLong = RollShort = 0; 
	
	vars Price = series(priceClose()),
		Fast = series(SMA(Price,3)),
		Slow = series(SMA(Price,30));
	
	static var BuyLimit,SellLimit,BuyStop,SellStop;
	
	if(crossOver(Fast,Slow)) {
		BuyStop = priceHigh() + 1*PIP;
		BuyLimit = priceHigh() + 5*PIP;
	}
	if(crossUnder(Fast,Slow)) {
		SellStop = priceLow() - 1*PIP;
		SellLimit = priceLow() - 5*PIP;
	}
		
	if(!NumOpenLong && Fast[0] > Slow[0] && Price[0] < BuyLimit)
		enterLong(1,BuyStop);
	if(!NumOpenShort && Fast[0] < Slow[0] && Price[0] > SellLimit)
		enterShort(1,SellStop);
}




Hi jcl. I have 2 questions for you. First question. The pending order 'enterLong(1,BuyStop)', is automatically cancelled after the end of the first bar if not entered. Is it correct?
Second question.
In the istruction 'if(!NumOpenLong && Fast[0] > Slow[0] && Price[0] < BuyLimit)' the part 'Fast[0] > Slow[0]' isn't redundant? (because the condition is already verified by the crossover function). And why did you use 'Price[0] < BuyLimit' if the BuyStop is smaller than BuyLimit?
Thanks a lot!

Re: Luxor system - Jaekle and Tomasini [Re: forexcoder] #450193
04/08/15 14:05
04/08/15 14:05
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, the pending order is cancelled after 1 bar unless you set EntryTime to a different number. And Fast[0] > Slow[0] is not redundant because the trade is not necessarily entered at the crossover. The crossover is for determining the entry limits only, and could have happened some bars earlier.

Re: Luxor system - Jaekle and Tomasini [Re: jcl] #450204
04/08/15 21:06
04/08/15 21:06
Joined: Feb 2015
Posts: 45
Italy
forexcoder Offline
Newbie
forexcoder  Offline
Newbie

Joined: Feb 2015
Posts: 45
Italy
Jcl thanks for your reply. I know that the crossover function is:
"bool crossOver(var* data1,var* data2) { return (data1[0] > data2[0]) && (data1[1] < data2[1]); }"
so Fast[0] > Slow[0] is already present in the function, also do not understand why BuyLimit is greater than BuyStop, should not it be the other way?
If Price[0] is < BuyLimit and > BuyStop, than when Zorro run 'enterLong(1,BuyStop)', the trade become a buy limit and not a buy stop, because BuyStop is < Price[0]. Is not it?
Thanks again for helping me to understand!

Page 5 of 5 1 2 3 4 5

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