Strategy Builder

Strategies are published here.

Moderator: admin

Re: Strategy Builder

Postby OilyFish » Mon Mar 21, 2011 3:49 pm

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

Postby Apprentice » Tue Mar 22, 2011 1:20 am

Your request has been added to developmental cue.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Strategy Builder

Postby STEIGO » Fri Apr 08, 2011 4:48 am

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

Postby Apprentice » Fri Apr 08, 2011 1:49 pm

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.
Adding advanced functionality.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Strategy Builder

Postby bingyunid » Wed Apr 13, 2011 10:19 am

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

Postby bingyunid » Fri Apr 15, 2011 2:11 am

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

Postby Apprentice » Fri Apr 15, 2011 2:20 am

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.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Strategy Builder

Postby bingyunid » Fri Apr 15, 2011 4:25 am

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

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

Postby Apprentice » Fri Apr 15, 2011 7:04 am

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.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Strategy Builder

Postby bingyunid » Tue Apr 19, 2011 11:01 pm

Got it. Thanks very much,Apprentice !
bingyunid
 
Posts: 11
Joined: Fri Apr 01, 2011 1:19 am

PreviousNext

Return to Custom Strategies

Who is online

Users browsing this forum: No registered users and 21 guests