Timeframes

Posted By: MatPed

Timeframes - 04/25/15 13:50

A couple of questions on using different timeframe in the same functions, Lets set in the run function:
Barperiod = 1 //one minute

now, lets create a single function that will set:

Timeframe= 60;
... Block A

Timeframe = 1;
... Block B

how many time will be executed in 1 hour the code in Block A & B?
It will be the same writing the same function as

Timeframe = 1;
... Block B

Timeframe= 60;
... Block A

It is recommended to code in this way or is better to have a single timeframe in a single function i.e. splitting the blcok A and Block B in 2 distint functions?

Thank You
Posted By: boatman

Re: Timeframes - 04/27/15 01:55

Your run function will execute every bar. In this case, every minute. My understanding is that Block A will only execute every 60th bar, while Block B will run every bar. I don't think you need to split different time frames into different functions, but I don't see why you couldn't. If you really wanted to, you could do something like:

function run()
{
BarPeriod = 1;
TimeFrame = 60;
myfunction1();
TimeFrame = 1;
myfunction2();
}
Posted By: MatPed

Re: Timeframes - 04/27/15 09:23

function boh()
{
TimeFrame = 60;
myfunction1();
TimeFrame = 1;
myfunction2();
}

function run()
{
BarPeriod = 1;
boh();
}

Ok thank you. you say that myfunction1 will be executed once a hour, myfunction2 every minute. I will give it a try, it seems too nice to be true laugh

I have tried to access to your Sico system, but is private. I was curious... Ciao
Posted By: boatman

Re: Timeframes - 04/27/15 23:06

Hmmm...don't remember setting it to private. I just logged in and it is definitely set to public. The system had an absolutely stellar few months, but has been in drawdown since the end of January. I am still running the algorithm, but it is very different to its original form and I continue to try new things with it.
Posted By: royal

Re: Timeframes - 04/28/15 08:53

The portfolio is private but the system is public. Try this link instead:

Sico System
© 2024 lite-C Forums