Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (blaurock), 750 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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: 82
T
TipmyPip Offline OP
Junior Member
TipmyPip  Offline OP
Junior Member
T

Joined: Sep 2017
Posts: 82
#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 Online
Serious User
AndrewAMD  Online
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