Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 02-12-2011, 10:23 AM   #1

Join Date: Feb 2011
Posts: 2
Ignore this user

Thanks: 0
Thanked 2 Times in 1 Post

AmiBroker Multiple Timeframe

Can anyone tell me where I'm going wrong?
I've managed to plot a weekly CCI Histogram, on my daily chart. However what I want to do is change the colour so that when its over 100 on the weekly, its green and when its over negative 100 its red.
Here's the coding I have managed so far, and I'm sure its where I'm positioning the IIF, but unfortunately none of the examples in the guide combine the two..


TimeFrameSet(inWeekly);
CCIW = CCI(20);
TimeFrameRestore();

Plot (TimeFrameExpand (CCIW, inWeekly), "CCI Weekly", IIf (CCIW, inWeekly > 100), colorGreen, colorBlack, styleHistogram);

Could anybody help? Or suggest an alternative to achieve the same..

Cheers
malaguti is offline  
Reply With Quote
Old 02-15-2011, 08:18 AM   #2

Head2k's Avatar

Join Date: Jul 2008
Location: N/A
Posts: 313
Ignore this user

Thanks: 140
Thanked 290 Times in 129 Posts

Re: AmiBroker Multiple Timeframe

Doesn't this return an error? Your line should be written like this:

Plot (TimeFrameExpand (CCIW, inWeekly), "CCI Weekly", IIf (TimeFrameExpand (CCIW, inWeekly) > 100, colorGreen, colorBlack), styleHistogram);


If you want to add the red color, then try this:

TimeFrameSet(inWeekly);
CCIW = CCI(20);
TimeFrameRestore();
CCIWexp = TimeFrameExpand (CCIW, inWeekly);

Plot (CCIWexp, "CCI Weekly", IIf (CCIWexp > 100, colorGreen, IIF (CCIWexp < -100, colorRed, colorBlack)), styleHistogram);
Head2k is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting a Timeframe for Your Charts blueberrycake Technical Analysis 16 10-26-2010 05:34 AM
Overlaying an Indicator from a Different Timeframe brownsfan019 Open E Cry 13 02-23-2010 09:59 AM
Add the Timeframe to the Alert Box in TS? daedalus Coding Forum 9 06-29-2009 10:24 PM
Multiple Profit Targets for Multiple Contracts palmcarl Automated Trading 23 04-10-2009 11:28 AM
Help W/ Avg Vol By TimeFrame ELD CuriousGeorge Coding Forum 1 04-05-2009 12:03 AM

All times are GMT -4. The time now is 03:26 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.