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

[amibroker] TimeFrameSet problem?



PureBytes Links

Trading Reference Links

I have a 30 Minute and 90 Minute chart on screen.

I have an indicator (code below) on each chart.

I want to put the indicator in 2 separate panes for both time frames
under the 30 minute chart.

The 30 minute is OK. On the 90 minute indicator the colors do not line
up, i.e., when the cursor is on the same time for both charts, the
colors are sometimes different for the 90 minute indicator on the 30
minute chart and the 90 minute indicator on the 90 minute chart.

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

/*Trend Indicator*/

tf=ParamList("timeframe","1M|2M|3M|5M|10M|15M|30M|1H|90M|4H|D|W|M",6);

switch (tf)
{
	case "1M": 
		TimeFrameSet( in1Minute );
		break;
	case "2M": 
		TimeFrameSet( 2*60 );
		break;
	case "3M": 
		TimeFrameSet( 3*60 );
		break;
	case "5M": 
		TimeFrameSet( in5Minute );
		break;
	case "10M": 
		TimeFrameSet( 10*60 );
		break;
	case "15M": 
		TimeFrameSet( in15Minute  );
		break;
	case "30M": 
		TimeFrameSet( 30*60  );
		break;
	case "H": 
		TimeFrameSet( inHourly );
		break;
	case "90M": 
		TimeFrameSet( 90*60 );
		break;
	case "4H": 
		TimeFrameSet( 4*60*60 );
		break;
	case "D": 
		TimeFrameSet( inDaily  );
		break;
	case "W": 
		TimeFrameSet( inWeekly  );
		break;
	case "M": 
		TimeFrameSet( inMonthly );
		break;
	default: 
		TimeFrameSet( 30*60  );
		break;
}

PF = ParamList("Price Field","O|H|L|C|V|OI|(L+H)/2|(H+L+C)/3",6);
switch (PF)
{
	case "O": 
		priceField=O;
		break;
	case "H": 
		priceField=H;
		break;
	case "L": 
		priceField=L;
		break;
	case "C": 
		priceField=C;
		break;
	case "V": 
		priceField=V;
		break;
	case "OI": 
		priceField=OI;
		break;
	case "(H+L)/2": 
		priceField=(H+L)/2;
		break;
	case "(H+L+C)/3": 
		priceField=(H+L+C)/3;
		break;
	default: 
		priceField=(H+L)/2;
		break;
}
regressionLength=Param("Regression Length",21,2,200);
smootherLength=Param("Smoother Length",2,2,200);

line1=LinearReg(priceField,regressionLength);

trend=Wilders(line1,smootherLength);

TimeFrameRestore();

trendColor=IIf(trend>=Ref(trend,-1),colorLightBlue,colorLightOrange);

Plot(trend,"",trendColor,ParamStyle("trend"));
GraphXSpace=20;

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





Please note that this group is for discussion between users only.

To get 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/