Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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,730
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,730
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