[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] TimeFrameSet code Problem?



PureBytes Links

Trading Reference Links

Any help would be cool... What i want to do is plot SD & SK 'storsi' 
on smaller time frames 3 5 7 minutes but only show buy/sell trade 
arrows when the hourly SD&SK 'storsi' lines are trending up - L dn-s. 
and the smaller time fram SD/SK 'storsi' cross . Im missing something 
here    the SD and SK are empty therefore no line plot?????

PeriodRSI= Param("PeriodRSI", 8, 1, 100, 1);
PeriodStoch=Param("PeriodStoch", 5, 1, 100, 1);
PeriodSK=Param("PeriodSK", 3, 1, 100, 1);
PeriodSD=Param("PeriodSD", 3, 1, 100, 1);
Upper=Param("Upper", 70, 50, 100, 1);
Lower=Param("Lower", 30, 0, 50, 1);

StoRSI = 100*(( RSI( PeriodRSI) - LLV( RSI( PeriodRSI ) , 
PeriodStoch )) /
	 ( (HHV( RSI( PeriodRSI) , PeriodStoch ) ) - LLV(RSI( 
PeriodRSI ),PeriodStoch ) ));
     SK = MA(StoRSI,PeriodSK);
     SD = MA(SK,PeriodSD);

TimeFrameSet( inHourly ); 
StoRSI_60= 100*(( RSI( PeriodRSI) - LLV( RSI( PeriodRSI ) , 
PeriodStoch )) / ( (HHV( RSI( PeriodRSI) , PeriodStoch ) ) - LLV(RSI( 
PeriodRSI ),PeriodStoch ) ));
     SK_60 = MA(StoRSI_60,PeriodSK);
     SD_60 = MA(SK_60,PeriodSD);


SK_60up = IIf( TimeFrameExpand(SK_60,inHourly) > 0 AND Ref
(TimeFrameExpand(SK_60,inHourly),-1) <
	 TimeFrameExpand(SK_60,inHourly),1 ,IIf( TimeFrameExpand
(SK_60,inHourly) <
	 0 AND Ref(TimeFrameExpand(SK_60,inHourly),-1) < 
TimeFrameExpand(SK_60,inHourly),1,0));
SK_60Dn = IIf( TimeFrameExpand(SK_60,inHourly) > 0 AND Ref
(TimeFrameExpand(SK_60,inHourly),-1) >
	 TimeFrameExpand(SK_60,inHourly),1 ,IIf( TimeFrameExpand
(SK_60,inHourly) <
	 0 AND Ref(TimeFrameExpand(SK_60,inHourly),-1) > 
TimeFrameExpand(SK_60,inHourly),1,0));
SD_60up = IIf( TimeFrameExpand(SD_60,inHourly) > 0 AND Ref
(TimeFrameExpand(SD_60,inHourly),-1) <
	 TimeFrameExpand(SD_60,inHourly),1 ,IIf( TimeFrameExpand
(SD_60,inHourly) <
	 0 AND Ref(TimeFrameExpand(SD_60,inHourly),-1) < 
TimeFrameExpand(SD_60,inHourly),1,0));
SD_60Dn = IIf( TimeFrameExpand(SD_60,inHourly) > 0 AND Ref
(TimeFrameExpand(SD_60,inHourly),-1) >
	 TimeFrameExpand(SD_60,inHourly),1 ,IIf( TimeFrameExpand
(SD_60,inHourly) <
	 0 AND Ref(TimeFrameExpand(SD_60,inHourly),-1) > 
TimeFrameExpand(SD_60,inHourly),1,0));

buyhourly = SK_60up AND SD_60up;
shorthourly = SK_60Dn AND SD_60Dn;

// Once buyDaily=1, InLongDaily stays 1 till shortDaily=1
InLonghourly = Flip(buyhourly, shorthourly);
// Once shortDaily=1, InShortDaily stays 1 till buyDaily=1
InShorthourly = Flip(shorthourly, buyhourly);
// restore to current time frame

TimeFrameRestore();

buyhourly = TimeFrameExpand( InLonghourly, inHourly );

Buy = buyhourly AND Cross(SK,SD);

Plot( SK, "5Min", colorWhite ,styleLine);
Plot( SD, "5min", colorBlack ,styleLine);

Plot(0,"ZeroLine",ParamColor( "ColorZero", colorWhite ),styleLine);
Plot(Upper,"Upper",ParamColor( "ColorUpper", colorTan ),styleLine);
Plot(Lower,"Lower",ParamColor( "ColorLower", colorTan ),styleLine);


------------------------------------

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/