Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 604 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Multi Timeframe support. [Re: AndrewAMD] #476773
03/30/19 11:34
03/30/19 11:34
Joined: Sep 2017
Posts: 81
T
TipmyPip Offline OP
Junior Member
TipmyPip  Offline OP
Junior Member
T

Joined: Sep 2017
Posts: 81
#define M5 (5*BarPeriod)
#define M1 (BarPeriod)
function run()
{
Capital = 5000;
Margin = 0.1;
BarPeriod = 1;
NumWFOCycles = 10; // activate WFO, 10 cycles

TimeFrame = M5;
vars PriceM5 = series(price());
vars TrendM5 = series(LowPass(PriceM5,1000));
vars SignalsM5 = series(0);

TimeFrame = M1;
vars PriceM1 = series(price());
vars TrendM1 = series(LowPass(PriceM1,1000));
vars SignalsM1 = series(0);

Stop = 4*ATR(100);
FuzzyRange = 0.001*ATR(100);

var Valley = valleyF(TrendM1),
Peak = peakF(TrendM1);
SignalsM1[0] = orF(Valley,Peak); // store the signal
SignalsM5[0] = orF(Valley,Peak); // store the signal
if(fuzzy(Valley))
exitShort();
if(fuzzy(andF(Valley,notF(Sum(SignalsM1+1,3)))))
enterLong();
if(fuzzy(Peak))
exitLong();
if(fuzzy(andF(Peak,notF(Sum(SignalsM5+1,3)))))
enterShort();
}

Last edited by TipmyPip; 03/30/19 11:35.

ZorroTraderGPT - https://bit.ly/3Gbsm4S
Re: Multi Timeframe support. [Re: TipmyPip] #476777
03/30/19 17:23
03/30/19 17:23
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
This approach appears correct on the surface, but why are you not making any use of the TrendM5 series? It defeated the purpose of changing the timeframe.

Page 2 of 2 1 2

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