Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
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
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, SBGuy, Petra), 801 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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 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