|
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible),
637
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Luxor system - Jaekle and Tomasini
[Re: RTG]
#439637
04/06/14 11:52
04/06/14 11:52
|
Joined: Jul 2013
Posts: 75
royal
Junior Member
|
Junior Member
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:
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
Newbie
|
Newbie
Joined: Feb 2015
Posts: 45
Italy
|
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!
|
|
|
|