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

[amibroker] Re: Backtest Long+Short # Long&Short



PureBytes Links

Trading Reference Links


Howdy David,
 
Each color gets its own number.  To see which colors are assigned to which numbers, go to Help, AmiBroker Formula Language, AFL Reference Manual.  There's a great AFL in the library that plots all the colors with their respective names and numbers as an indicator.  Very helpful in quickly determining which colors show up best with you background.
 
So, even though you see the reserved word colorBlack, AFL actually interprets that reserved word as the number 16.  Consequently, in your example you will get the result of the color number.
 
TrueCond1 * TrueCond2 * colorBlack is the same as...
 
1 * 1 * 16 = 16
 
You can use the same idea in Plot statements as Dimitris has insightfully pointed out.
 
UpClose = C > Ref(C, -1);
 
Plot(C, "My Close",  UpClose * colorGreen + Not(UpClose) * colorRed, styleline);
 
This will give green if higher close and red if lower close.
 
Hope this helps,
Garywooziwog <xcitemint@xxxxxxx> wrote:
Hi,I studied the explanation that Dimitris provided regarding my question about his formula for the Trin Ribbon. Thank you for providing such a concise and detailed explanation. I read the comment about Tomasz providing both color names and also numbers that identifies the colors.  My understanding of the formula in logical terms based on the explanation provided by Dimitris is as follows:If ALL conditions for statement are true all Values =1therefore1 x 1 x colorname (or number) results in "true" for color since the final result is "1"andIf ANY conditions are false Value will equal 0therefore 1 x 0 x colorname (or number) results in "false" since any 0 in multiplication will make ultimate result 0 and color will be "false".Is this correct?  Does the fact that the colors have number values
 make this formula work?  Would this formula work if no number values were associated with the colors?  David K.All the colors in AFL are actually numbers which is why you can include them in mathematical equations as DT has done below.  Tomsaz was good enough to Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.