HI,
from the manual
Workshop 6: Portfolio strategies. Money management.

Quote:
What does this mean? The trend trading strategy from workshop 4 used 60-minutes bars, while counter trend trading was based on 240-minutes bars. When we trade both together in the same script, we'll need both types of bars. The BarPeriod variable must not be changed at runtime, as it determines the sampling of the price curves. But the TimeFrame variable does the job. Alice has set BarPeriod to 60 minutes, so it needs a TimeFrame of 4 bars for getting the 240 minutes period for the counter trend strategy. TimeFrame affects all subsequent price and series calls, all indicators using those series, and the ATR function.


I have this code:

Quote:

//--------------- Frame 10 ---------------
int Frame10(){
TimeFrame= 60; // 60 minute ???

if (AlgoVar[0] > -2){
AlgoVar[0]--;
printf("\nDNT minute %d AlgoVar %.1f", minute(),AlgoVar[0]);

}else AlgoVar[0]=5;
return 0;
}

function run()
{
StartDate = 20160101;
EndDate=20160131;
set(LOGFILE);
BarPeriod = 1; // 1 minute bars
Hedge = 2;
Stop=1000*PIP;
TakeProfit=1000*PIP;
Frame10();
}


I got this result:

Quote:

DNT minute 3 AlgoVar 2.0
DNT minute 4 AlgoVar 1.0
DNT minute 5 AlgoVar 0.0
DNT minute 6 AlgoVar -1.0
DNT minute 7 AlgoVar -2.0
DNT minute 9 AlgoVar 4.0
DNT minute 10 AlgoVar 3.0
DNT minute 11 AlgoVar 2.0
DNT minute 12 AlgoVar 1.0
DNT minute 13 AlgoVar 0.0
DNT minute 14 AlgoVar -1.0
DNT minute 15 AlgoVar -2.0


function Frame10() is called every 1 minute bar and execute code inside. Except the indicator - this is a correct - call every 60 minute.