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

[amibroker] Colorization not working - simple code



PureBytes Links

Trading Reference Links

Hi folks;

Explore problem.

I have this simple binary which can add up to 20, made up of 5 
components wiht a max value of 4 each, so for simplicity I have 
changed them to simple numbers to try and resolve this problem:

My Binary colorizing is based on how great the number is (higher gets 
greener, lower gets redder). Why do my individual components not 
change color, but all remain brightgreen ? (I'm using the same code 
to colorize both).

// Test values to show colorization
BB_Phases_Binary = LastValue(Random())* 4;
EMA_Binary = LastValue(Random()) * 4;
ADX_Binary = LastValue(Random()) * 4 ;
MACD_Binary = LastValue(Random())* 4;
SAR_Binary = LastValue(Random())* 4;

Binarys = ((BB_Phases_Binary) + (EMA_Binary) + (ADX_Binary) + 
(MACD_Binary) + (SAR_Binary));
BinaryMax = 20;

Buy = ((Binarys / BinaryMax ) >= .85);
Sell = (Binarys / BinaryMax ) <= .55;

// Start Add Columns
SetOption("NoDefaultColumns",True);
AddTextColumn(Name(),"Name",1.0,colorBlack,colorDefault,50);
AddColumn(DateTime
(),"Date",formatDateTime,colorBlack,colorDefault,60);
AddTextColumn(FullName(), "Name",1.0,IIf(BarCount-
1,colorGreen,colorTan),colorDefault,120);
AddTextColumn(IndustryID
(1),"Industry",1.0,colorBlack,colorDefault,100);

AddColumn(Binarys,"Binarys",1.0,colorBlack, 
                                IIf(Binarys >= 17,colorBrightGreen,
                                IIf(Binarys >= 15,colorPaleGreen,
                                IIf(Binarys >= 13,colorYellow,
                                IIf(Binarys >= 
11,colorPink,colorRed)))),45);

//Makeup of Binaries components - colorized

AddColumn(BB_Phases_Binary,"BB",1.0,colorBlack,
                                IIf(BB_Phases_Binary = 
4,colorBrightGreen,
                                IIf(BB_Phases_Binary = 
3,colorPaleGreen,
                                IIf(BB_Phases_Binary = 2,colorYellow,
                                IIf(BB_Phases_Binary = 
1,colorPink,colorRed)))),35);

AddColumn(EMA_Binary,"EMA",1.0,colorBlack,
                                IIf(EMA_Binary = 4,colorBrightGreen,
                                IIf(EMA_Binary = 3,colorPaleGreen,
                                IIf(EMA_Binary = 2,colorYellow,
                                IIf(EMA_Binary = 
1,colorPink,colorRed)))),35);

AddColumn(ADX_Binary,"ADX",1.0,colorBlack,
                                IIf(ADX_Binary = 4,colorBrightGreen,
                                IIf(ADX_Binary = 3,colorPaleGreen,
                                IIf(ADX_Binary = 2,colorYellow,
                                IIf(ADX_Binary = 
1,colorPink,colorRed)))),35);
 
AddColumn(MACD_Binary,"MACD",1.0,colorBlack,
                                IIf(MACD_Binary = 4,colorBrightGreen,
                                IIf(MACD_Binary = 3,colorPaleGreen,
                                IIf(MACD_Binary = 2,colorYellow,
                                IIf(MACD_Binary = 
1,colorPink,colorRed)))),45);

AddColumn(SAR_Binary,"SAR",1.0,colorBlack,
                                IIf(SAR_Binary = 4,colorBrightGreen,
                                IIf(SAR_Binary = 3,colorPaleGreen,
                                IIf(SAR_Binary = 2,colorYellow,
                                IIf(SAR_Binary = 
1,colorPink,colorRed)))),35);

Filter = C > 1;

Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy ); 

PlotShapes(Buy*shapeHollowUpArrow,colorGreen,0,Low,-50);
PlotShapes(Sell*shapeHollowDownArrow,colorRed,0,High,-30);

Sort1 = Param("Sort1",-2,-8,8,1);
Sort2 = Param("Sort2",-5,-8,8,1);
Sort3 = Param("Sort3",-10,-10,8,1);
SetSortColumns (Sort1,Sort2,Sort3);


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

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