Hi guys! I'm working on one simple afl but it can't work. I have a simple chart with 30 min periodicity and a put a stoch indicator below which is 4 hourly(it's own timeframe).. this is only the "4 hourly stoch indicator": _SECTION_BEGIN("stochastic 4 hourly"); TimeFrameSet(4*inHourly); slow= StochD(5,3,3); fast=StochK(5,3); TimeFrameRestore(); Plot(TimeFrameExpand(slow, 4*inHourly),"Stoch 5,3,3", colorRed); Plot(TimeFrameExpand(fast, 4*inHourly), "Stoch 5,3", colorBlue); _SECTION_END(); and then I make a simple scan but it put everywhere a buy arrow on the 4 hourly stochastic TimeFrameSet(4*inHourly); stok=StochK(5,3); stod=StochD(5,3,3); TimeFrameRestore(); Buy=stok>stod; not only when the 5,3 bigger than the 5,3,3 but the 5,3 is smaller than 5,3,3.. this is my biggest problem... thank you bye pikk-pak
I tried that but the same problem... I attach a jpg picture so you can see what happened....the main chart is 30 min, my second stoch is the 4 hourly...and the third indicator is daily...
try this TimeFrameSet(4*inHourly); stok=StochK(5,3); stod=StochD(5,3,3); Buy=cross(stok,stod); sell=cross(stod,stok); TimeFrameRestore();
2 thoughts: I don't have time to play w/ it right now but you may have to put a timeframexpand statement into the stochk and stochd before buy/sell statements. not sure but you may want to look at that . Also, there is a very active Amibroker board on yahoo where you have a lot of good amibroker folks...you may want to try that. Mike
thx mlsiqnups!! it looks like it worked... _SECTION_BEGIN("stochastic 4 hourly"); TimeFrameSet(4*inHourly); slow=StochD(5,3,3); fast=StochK(5,3); TimeFrameRestore(); _SECTION_END(); Buy=TimeFrameExpand(slow, 4*inHourly) < TimeFrameExpand(fast, 4*inHourly);