## Strategy Builder

Strategies are published here.

### Re: Strategy Builder

Is there any chance of developing this a bit further; so that individual time frames can be assigned to different component strategies and also can it be expanded to allow more than 3 strategies in it, say around 6?
OilyFish

Posts: 30
Joined: Mon May 17, 2010 12:51 pm

### Re: Strategy Builder

Your request has been added to developmental cue.

Apprentice
FXCodeBase: Confirmed User

Posts: 18995
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Strategy Builder

How does this strategy work?
How do I use it?
What is it trying to do?
Is there a thread or coding request link that will explain what it tries to do?
STEIGO

Posts: 20
Joined: Thu Apr 07, 2011 5:28 pm

### Re: Strategy Builder

This is not a classic strategy.
In the first place i am using it for test different combinations of indicators.
When I find a promising strategy.
I continue to develop it as an independent strategy.

Although there is the possibility of trading.
Do not give the possibility of fine tuning.

Apprentice
FXCodeBase: Confirmed User

Posts: 18995
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Strategy Builder

Hi,thanks for developping this strategy. Now i have a problem on this,why it open orders,why it didn't set stop/limit,it just open without set the stop or limit. I have already changing the setting to set stop/limit,anybody can help me ,thanks very much
bingyunid

Posts: 11
Joined: Fri Apr 01, 2011 1:19 am

### Re: Strategy Builder

I have solved the problem i mentioned above, it is because the account type, my demo accout cannot set, but my live accout works correctly.

BTW, if i want to add a rule to this logic, when the TMACD bar above/below 0 AND it just cross the zero line, then plus(i)/minus(i) .

The oraginal source code is:
elseif instance.parameters:getString("IN"..i) == "TMACD" then
STREAMS[0]=indicator[i]:getStream(0);
if STREAMS[0][p] > 0 then
PLUS(i);
elseif STREAMS[0][p] < 0 then
MINUS(i);
end

I change to
elseif instance.parameters:getString("IN"..i) == "TMACD" then
STREAMS[0]=indicator[i]:getStream(0);
if STREAMS[0][p] > 0 and core.crosses(STREAMS[0], 0, p) then
PLUS(i);
elseif STREAMS[0][p] < 0 and core.crosses(STREAMS[0], 0, p) then
MINUS(i);
end

it seems work ok, but when i backtest it, it give errors: index is out of range,Apprentice,could you help me ,thanks very much
bingyunid

Posts: 11
Joined: Fri Apr 01, 2011 1:19 am

### Re: Strategy Builder

core.crosses function should have two data periods that would work.
Former and current period, P and P-1
This check should fix things.

if not STREAMS[0]:hasData(p) or not STREAMS[0]:hasData(p-1) then
return;
end

And this piece of code before the Cross Check.

Apprentice
FXCodeBase: Confirmed User

Posts: 18995
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Strategy Builder

Thanks very much, Apprentice . The error has been fixed after adding your code.

Could you help on another problem which trouble me very long time. In the Strategy Builder.lua, if i want to combine two indicators(Two indicators both signal sell/buy then sell/buy,). For example.
rule: When TMACD > 0 ; in the meantime, the CCI >0, then buy.

That means, the two indicator both signal buy (PLUS(i)), then buy (PLUS(i)), is it possible to code it?

CCI code
elseif instance.parameters:getString("IN"..i) == "CCI" then

STREAMS[0]=indicator[i]:getStream(0);

if STREAMS[0][p] > 0 then
PLUS(i);
elseif STREAMS[0][p] < 0 then
MINUS(i);
end
TMACD code
elseif instance.parameters:getString("IN"..i) == "TMACD" then

STREAMS[0]=indicator[i]:getStream(0);

if STREAMS[0][p] > 0 then
PLUS(i);
elseif STREAMS[0][p] < 0 then
MINUS(i);
end
bingyunid

Posts: 11
Joined: Fri Apr 01, 2011 1:19 am

### Re: Strategy Builder

This is no easy task.

This requires a complete change of codes.

There are Two solutions.

FIrst, Add an option, mandatory confirmation.
So you can define which individual signals must be positive.
To have a positive indication.

Second, change the selection algo. from individual indicators to strategy.
Currenty strategy only works with the individual indicators.
You should develop a different engine.

Apprentice
FXCodeBase: Confirmed User

Posts: 18995
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Strategy Builder

Got it. Thanks very much,Apprentice !
bingyunid

Posts: 11
Joined: Fri Apr 01, 2011 1:19 am

PreviousNext