Mutiple time frame in trading system and multi conditions in afl

#1
Hi everyone.

I have a problem, I try to write a system which I wish to test but it seems to be way harder that I thought at the begining.

I wish to start with daily data, so:

TimeFrameSet(inDaily);


and under given conditions for daily interval like:

%K < 30 And %D < 30 and Cross(%K,%D)


I wish to skip to hourly interval giving other conditions.

In other words I trade on hourly interval and I take long position only when upper time frame shows oversold and shows willing to recovery :).

Have anyone has an idea how to deal with such problem.

I am a rookie regarding AFL, btw.
 

Abhi1284

Active Member
#2
Hi everyone.

I have a problem, I try to write a system which I wish to test but it seems to be way harder that I thought at the begining.

I wish to start with daily data, so:

TimeFrameSet(inDaily);


and under given conditions for daily interval like:

%K < 30 And %D < 30 and Cross(%K,%D)


I wish to skip to hourly interval giving other conditions.

In other words I trade on hourly interval and I take long position only when upper time frame shows oversold and shows willing to recovery :).

Have anyone has an idea how to deal with such problem.

I am a rookie regarding AFL, btw.
I THINK THIS WILL HELP U PLOT UR STOCH AFL INSTED OF ADX IN BELOW AFL

THANX
ABHISHEK


_SECTION_BEGIN("ADX with multiple Timeframe");
range = Param("Periods", 14, 2, 200, 1 );
p = ParamList("Timeframe", "5 Minute|15 Minute|Hourly|Daily|Weekly|Monthly", 3);
switch (p) {
case "5 Minute": tf = in5Minute; break;
case "15 Minute": tf = in15Minute; break;
case "Hourly": tf = inHourly; break;
case "Daily": tf = inDaily; break;
case "Weekly": tf = inWeekly; break;
case "Monthly": tf = inMonthly; break;
default: tf = inDaily; break;
}

TimeFrameSet(tf);
adxVal = ADX(range);
pdiVal = PDI(range);
mdiVal = MDI(range);
TimeFrameRestore();

Plot(TimeFrameExpand(adxVal, tf), "ADX in " + p, ParamColor( "ADX color", colorBlue ), ParamStyle("ADX style", styleThick ) );
Plot(TimeFrameExpand(pdiVal, tf), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot(TimeFrameExpand(mdiVal, tf), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );

Plot(Param("Signal Line", 24, 20, 30, 1), "", ParamColor("Signal Line color", colorBlack), ParamStyle("Signal Line style", styleLine|styleThick|styleNoLabel));
_SECTION_END();
 
#3
I THINK THIS WILL HELP U PLOT UR STOCH AFL INSTED OF ADX IN BELOW AFL

THANX
ABHISHEK


_SECTION_BEGIN("ADX with multiple Timeframe");
range = Param("Periods", 14, 2, 200, 1 );
p = ParamList("Timeframe", "5 Minute|15 Minute|Hourly|Daily|Weekly|Monthly", 3);
switch (p) {
case "5 Minute": tf = in5Minute; break;
case "15 Minute": tf = in15Minute; break;
case "Hourly": tf = inHourly; break;
case "Daily": tf = inDaily; break;
case "Weekly": tf = inWeekly; break;
case "Monthly": tf = inMonthly; break;
default: tf = inDaily; break;
}

TimeFrameSet(tf);
adxVal = ADX(range);
pdiVal = PDI(range);
mdiVal = MDI(range);
TimeFrameRestore();

Plot(TimeFrameExpand(adxVal, tf), "ADX in " + p, ParamColor( "ADX color", colorBlue ), ParamStyle("ADX style", styleThick ) );
Plot(TimeFrameExpand(pdiVal, tf), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot(TimeFrameExpand(mdiVal, tf), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );

Plot(Param("Signal Line", 24, 20, 30, 1), "", ParamColor("Signal Line color", colorBlack), ParamStyle("Signal Line style", styleLine|styleThick|styleNoLabel));
_SECTION_END();
Good One .

Thanks.
 
#4
GOOD WORK
CAN U ALSO TRY TO SOLVE THIS
http://www.traderji.com/amibroker/78793-need-chenges-afl.html

I THINK THIS WILL HELP U PLOT UR STOCH AFL INSTED OF ADX IN BELOW AFL

THANX
ABHISHEK


_SECTION_BEGIN("ADX with multiple Timeframe");
range = Param("Periods", 14, 2, 200, 1 );
p = ParamList("Timeframe", "5 Minute|15 Minute|Hourly|Daily|Weekly|Monthly", 3);
switch (p) {
case "5 Minute": tf = in5Minute; break;
case "15 Minute": tf = in15Minute; break;
case "Hourly": tf = inHourly; break;
case "Daily": tf = inDaily; break;
case "Weekly": tf = inWeekly; break;
case "Monthly": tf = inMonthly; break;
default: tf = inDaily; break;
}

TimeFrameSet(tf);
adxVal = ADX(range);
pdiVal = PDI(range);
mdiVal = MDI(range);
TimeFrameRestore();

Plot(TimeFrameExpand(adxVal, tf), "ADX in " + p, ParamColor( "ADX color", colorBlue ), ParamStyle("ADX style", styleThick ) );
Plot(TimeFrameExpand(pdiVal, tf), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot(TimeFrameExpand(mdiVal, tf), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );

Plot(Param("Signal Line", 24, 20, 30, 1), "", ParamColor("Signal Line color", colorBlack), ParamStyle("Signal Line style", styleLine|styleThick|styleNoLabel));
_SECTION_END();
 
#5
I THINK THIS WILL HELP U PLOT UR STOCH AFL INSTED OF ADX IN BELOW AFL

THANX
ABHISHEK


_SECTION_BEGIN("ADX with multiple Timeframe");
range = Param("Periods", 14, 2, 200, 1 );
p = ParamList("Timeframe", "5 Minute|15 Minute|Hourly|Daily|Weekly|Monthly", 3);
switch (p) {
case "5 Minute": tf = in5Minute; break;
case "15 Minute": tf = in15Minute; break;
case "Hourly": tf = inHourly; break;
case "Daily": tf = inDaily; break;
case "Weekly": tf = inWeekly; break;
case "Monthly": tf = inMonthly; break;
default: tf = inDaily; break;
}

TimeFrameSet(tf);
adxVal = ADX(range);
pdiVal = PDI(range);
mdiVal = MDI(range);
TimeFrameRestore();

Plot(TimeFrameExpand(adxVal, tf), "ADX in " + p, ParamColor( "ADX color", colorBlue ), ParamStyle("ADX style", styleThick ) );
Plot(TimeFrameExpand(pdiVal, tf), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot(TimeFrameExpand(mdiVal, tf), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );

Plot(Param("Signal Line", 24, 20, 30, 1), "", ParamColor("Signal Line color", colorBlack), ParamStyle("Signal Line style", styleLine|styleThick|styleNoLabel));
_SECTION_END();
I have same question but situation is oppsite. I work in 15min candles.... and if certain condition(signal) is generated in 5min candle how to show it in 15 min candle chart.
 

Similar threads