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

[amibroker] How can I Plot using timeframset-expand



PureBytes Links

Trading Reference Links

I want to plot a styleline SD & SK 'storsi'on 3 and 5 minute time 
chart BUT only show buy/sell trade arrows when the hourly 
SD&SK 'storsi' lines are trending up - L dn-s. AND the smaller time 
frame SD/SK 'storsi' cross . Shouldn't this code work????

PeriodRSI = 8;
PeriodStoch = 5;
PeriodSK = 3;
PeriodSD = 3;


StoRSI = 100*(( RSI( PeriodRSI) - LLV( RSI( PeriodRSI ) ,
PeriodStoch )) /( (HHV( RSI( PeriodRSI) , PeriodStoch ) ) - LLV(RSI(
PeriodRSI ),PeriodStoch ) ));

SK = MA(StoRSI,PeriodSK);
SD = MA(SK,PeriodSD);

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


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;

InLonghourly = Flip(buyhourly, shorthourly);
InShorthourly = Flip(shorthourly, buyhourly);

// restore to current time frame
TimeFrameRestore();

buyhourly = TimeFrameExpand( InLonghourly, inHourly );

Buy = buyhourly AND Cross(SK,SD);

PlotShapes(IIf( (Buy), 57, shapeNone),colorYellow,0,C,15); 






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

**** 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/