AFL highlighter for ConTEXT (free editor) (340).afl
上传用户:shiqiang
上传日期:2009-06-12
资源大小:1289k
文件大小:13k
源码类别:

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    AFL highlighter for ConTEXT (free editor)
  4. //  Author/Uploader: Dave Merrill 
  5. //  E-mail:          
  6. //  Date/Time Added: 2004-02-14 08:19:59
  7. //  Origin:          Based on Geoff Mulhall's original version in the library, updated to AB 4.5 and tweaked since.
  8. //  Keywords:        ConTEXT editor highlight
  9. //  Level:           semi-advanced
  10. //  Flags:           system,exploration,indicator,commentary,function
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=340
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=340
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  ConTEXT is a really good freeware programmer's editor, available at
  17. //  http://www.fixedsys.com/context. This file teaches it AFL's keywords, so it
  18. //  can color and format them like AmiBroker does. I often keep my standard AFL
  19. //  #include file open in it while working in AB.
  20. //
  21. //  Since there doesn't appear to be any direct way to capture all the keywords
  22. //  in use in the current version of AB, maintenance of this file is dependant
  23. //  on me or someone else noticing missing items. So, any additions and
  24. //  corrections are most welcome (:-). Please write directly to dmerrill at usa
  25. //  dot net, in case I don't come back here right away.
  26. //
  27. //  Thanks to Graham Kavanagh and Jack Fagen for their feedback.
  28. //
  29. //  NOTE: This is the last version of this that I'll be posting, since I'm no
  30. //  longer using ConTEXT and have no way to test it. (That's why I'm not
  31. //  deleting the previous version here; this is untested, but it'll probably be
  32. //  fine.) I've moved to UltraEdit, and for now anyway, it looks like I'll be
  33. //  maintaining a highlighter for it instead. The highlighter file formats
  34. //  aren't quite the same, but they're close enough that you can pull keyword
  35. //  updates out of there with very little work, if you want.
  36. //
  37. //------------------------------------------------------------------------------
  38. //////////////////////////////////////////////////////////////////////////////
  39. //
  40. // Amibroker Formula Language 
  41. //
  42. //////////////////////////////////////////////////////////////////////////////
  43. //////////////////////////////////////////////////////////////////////////////
  44. // language name
  45. Language:               AFL
  46. //////////////////////////////////////////////////////////////////////////////
  47. // default file filter
  48. // note: if more than one extension is associated, eg:
  49. // C/C++ files (*.c,*.cpp,*.h,*.hpp)|*.c;*.cpp;*.h;*.hpp
  50. Filter:                 AFL files (*.afl)|*.afl
  51. //////////////////////////////////////////////////////////////////////////////
  52. // help file which will be invokend when F1 is pressed
  53. HelpFile: C:Program FilesAmiBrokerBroker.chm
  54. //////////////////////////////////////////////////////////////////////////////
  55. // language case sensitivity
  56. //                      0  - no
  57. //                      1  - yes
  58. CaseSensitive:          0
  59. //////////////////////////////////////////////////////////////////////////////
  60. // comment type: LineComment - comment to the end of line
  61. // BlockCommentBeg - block comment begin, it could be
  62. // multiline
  63. // BlockCommentEnd - block comment end
  64. LineComment:            //
  65. BlockCommentBeg:        /*
  66. BlockCommentEnd:        */
  67. //////////////////////////////////////////////////////////////////////////////
  68. // identifier characters
  69. // note: characters shouldn't be delimited, except arrays
  70. // array of chars could be defined as from_char..to_char
  71. IdentifierBegChars:     a..z A..Z _
  72. IdentifierChars:        a..z A..Z _ 0..9 
  73. //////////////////////////////////////////////////////////////////////////////
  74. // numeric constants begin characters
  75. // note: characters shouldn't be delimited, except arrays
  76. // array of chars could be defined as from_char..to_char
  77. // number always starts with 0..9 except when NumConstBeg
  78. // defines other
  79. NumConstBegChars:       0..9 
  80. //////////////////////////////////////////////////////////////////////////////
  81. // numeric constants characters
  82. // note: characters shouldn't be delimited, except arrays
  83. // array of chars could be defined as from_char..to_char
  84. // number always starts with 0..9 except when NumConstBeg
  85. // defines other
  86. NumConstChars:          0..9 A..Z . -
  87. //////////////////////////////////////////////////////////////////////////////
  88. // escape character
  89. EscapeChar:
  90. //////////////////////////////////////////////////////////////////////////////
  91. // keyword table
  92. // note: delimited with spaces, lines could be wrapped
  93. // you may divide keywords into five groups which can be
  94. // highlighted differently
  95. // reserved words and variable names
  96. KeyWords1:
  97. // reserved words
  98. AND
  99. False
  100. NOT
  101. Null
  102. OR
  103. True
  104. // reserved variable names
  105. Avg
  106. BarCount
  107. Buy
  108. BuyPrice
  109. C
  110. Close
  111. Column0
  112. Column0Format
  113. Column0Name
  114. Column1
  115. Column1Format
  116. Column1Name
  117. Column2
  118. Column2Format
  119. Column2Name
  120. Column3
  121. Column3Format
  122. Column3Name
  123. Column4
  124. Column4Format
  125. Column4Name
  126. Column5
  127. Column5Format
  128. Column5Name
  129. Column6
  130. Column6Format
  131. Column6Name
  132. Column7
  133. Column7Format
  134. Column7Name
  135. Column8
  136. Column8Format
  137. Column8Name
  138. Column9
  139. Column9Format
  140. Column9Name
  141. Cover
  142. CoverPrice
  143. Exclude
  144. Filter
  145. Graph0
  146. Graph0BarColor
  147. Graph0Color
  148. Graph0High
  149. Graph0Low
  150. Graph0Name
  151. Graph0Open
  152. Graph0Style
  153. Graph1
  154. Graph1BarColor
  155. Graph1Color
  156. Graph1High
  157. Graph1Low
  158. Graph1Name
  159. Graph1Open
  160. Graph1Style
  161. Graph2
  162. Graph2BarColor
  163. Graph2Color
  164. Graph2High
  165. Graph2Low
  166. Graph2Name
  167. Graph2Open
  168. Graph2Style
  169. Graph3
  170. Graph3BarColor
  171. Graph3Color
  172. Graph3High
  173. Graph3Low
  174. Graph3Name
  175. Graph3Open
  176. Graph3Style
  177. Graph4
  178. Graph4BarColor
  179. Graph4Color
  180. Graph4High
  181. Graph4Low
  182. Graph4Name
  183. Graph4Open
  184. Graph4Style
  185. Graph5
  186. Graph5BarColor
  187. Graph5Color
  188. Graph5High
  189. Graph5Low
  190. Graph5Name
  191. Graph5Open
  192. Graph5Style
  193. Graph6
  194. Graph6BarColor
  195. Graph6Color
  196. Graph6High
  197. Graph6Low
  198. Graph6Name
  199. Graph6Open
  200. Graph6Style
  201. Graph7
  202. Graph7BarColor
  203. Graph7Color
  204. Graph7High
  205. Graph7Low
  206. Graph7Name
  207. Graph7Open
  208. Graph7Style
  209. Graph8
  210. Graph8BarColor
  211. Graph8Color
  212. Graph8High
  213. Graph8Low
  214. Graph8Name
  215. Graph8Open
  216. Graph8Style
  217. Graph9
  218. Graph9BarColor
  219. Graph9Color
  220. Graph9High
  221. Graph9Low
  222. Graph9Name
  223. Graph9Open
  224. Graph9Style
  225. GraphXSpace
  226. GraphZOrder
  227. H
  228. High
  229. L
  230. Low
  231. MarginDeposit
  232. MaxGraph
  233. NumColumns
  234. O
  235. OI
  236. Open
  237. OpenInt
  238. PointValue
  239. PositionScore
  240. PositionSize
  241. RoundLotSize
  242. Sell
  243. SellPrice
  244. Short
  245. ShortPrice
  246. TickSize
  247. Title
  248. V
  249. Volume
  250. // constants
  251. colorAqua
  252. colorBlack
  253. colorBlue
  254. colorBlueGrey
  255. colorBrightGreen
  256. colorBrown
  257. colorCustom1
  258. colorCustom10
  259. colorCustom11
  260. colorCustom12
  261. colorCustom13
  262. colorCustom14
  263. colorCustom15
  264. colorCustom16
  265. colorCustom2
  266. colorCustom3
  267. colorCustom4
  268. colorCustom5
  269. colorCustom6
  270. colorCustom7
  271. colorCustom8
  272. colorCustom9
  273. colorDarkBlue
  274. colorDarkGreen
  275. colorDarkGrey
  276. colorDarkOliveGreen
  277. colorDarkRed
  278. colorDarkTeal
  279. colorDarkYellow
  280. colorDefault
  281. colorGold
  282. colorGreen
  283. colorGrey40
  284. colorGrey50
  285. colorIndigo
  286. colorLavender
  287. colorLightBlue
  288. colorLightGrey
  289. colorLightOrange
  290. colorLightYellow
  291. colorLime
  292. colorOrange
  293. colorPaleBlue
  294. colorPaleGreen
  295. colorPaleTurquoise
  296. colorPink
  297. colorPlum
  298. colorRed
  299. colorRose
  300. colorSeaGreen
  301. colorSkyblue
  302. colorTan
  303. colorTeal
  304. colorTurquoise
  305. colorViolet
  306. colorWhite
  307. colorYellow
  308. compressHigh
  309. compressLast
  310. compressLow
  311. compressOpen
  312. compressVolume
  313. expandFirst
  314. expandLast
  315. expandPoint
  316. in15Minute
  317. in1Minute
  318. in5Minute
  319. inDaily
  320. inHourly
  321. inMonthly
  322. inWeekly
  323. scoreNoRotate
  324. shapeCircle
  325. shapeDigit0
  326. shapeDigit1
  327. shapeDigit2
  328. shapeDigit3
  329. shapeDigit4
  330. shapeDigit5
  331. shapeDigit6
  332. shapeDigit7
  333. shapeDigit8
  334. shapeDigit9
  335. shapeDownArrow
  336. shapeDownTriangle
  337. shapeHollowCircle
  338. shapeHollowDownArrow
  339. shapeHollowDownTriangle
  340. shapeHollowSmallCircle
  341. shapeHollowSmallDownTriangle
  342. shapeHollowSmallSquare
  343. shapeHollowSmallUpTriangle
  344. shapeHollowSquare
  345. shapeHollowStar
  346. shapeHollowUpArrow
  347. shapeHollowUpTriangle
  348. shapeNone
  349. shapePositionAbove
  350. shapeSmallCircle
  351. shapeSmallDownTriangle
  352. shapeSmallSquare
  353. shapeSmallUpTriangle
  354. shapeSquare
  355. shapeStar
  356. shapeUpArrow
  357. shapeUpTriangle
  358. styleArea
  359. styleBar
  360. styleCandle
  361. styleDots
  362. styleHistogram
  363. styleLeftAxisScale
  364. styleLine
  365. styleNoDraw
  366. styleNoLabel
  367. styleNoLine
  368. styleNoRescale
  369. styleOwnScale
  370. stylePointAndFigure
  371. styleStaircase
  372. styleSwingDots
  373. styleThick
  374. // functions
  375. KeyWords2:
  376. ADLine
  377. ADX
  378. AMA
  379. AMA2
  380. ATR
  381. AccDist
  382. AddColumn
  383. AddTextColumn
  384. AddToComposite
  385. AdvIssues
  386. AdvVolume
  387. AlertIf
  388. ApplyStop
  389. BBandBot
  390. BBandTop
  391. BarIndex
  392. BarsSince
  393. BeginValue
  394. CCI
  395. CategoryAddSymbol
  396. CategoryGetName
  397. CategoryGetSymbols
  398. CategoryRemoveSymbol
  399. Chaikin
  400. Correlation
  401. CreateObject
  402. CreateStaticObject
  403. Cross
  404. Cum
  405. DEMA
  406. Date
  407. DateNum
  408. DateTime
  409. Day
  410. DayOfWeek
  411. DayOfYear
  412. DecIssues
  413. DecVolume
  414. EMA
  415. EnableRotationalTrading
  416. EnableScript
  417. EnableTextOutput
  418. EncodeColor
  419. EndValue
  420. Equity
  421. ExRem
  422. ExRemSpan
  423. Flip
  424. Foreign
  425. FullName
  426. GapDown
  427. GapUp
  428. GetBaseIndex
  429. GetCategorySymbols
  430. GetChartID
  431. GetDatabaseName
  432. GetExtraData
  433. GetScriptObject
  434. GroupID
  435. HHV
  436. HHVBars
  437. Highest
  438. HighestBars
  439. HighestSince
  440. HighestSinceBars
  441. Hold
  442. Hour
  443. IIf
  444. InWatchList
  445. IndustryID
  446. Inside
  447. Interval
  448. IsEmpty
  449. IsFavorite
  450. IsFinite
  451. IsIndex
  452. IsNan
  453. IsNull
  454. IsTrue
  455. LLV
  456. LLVBars
  457. LastValue
  458. LinRegIntercept
  459. LinRegSlope
  460. LineArray
  461. LinearReg
  462. Lowest
  463. LowestBars
  464. LowestSince
  465. LowestSinceBars
  466. MA
  467. MACD
  468. MDI
  469. MFI
  470. MarketID
  471. Max
  472. Median
  473. Min
  474. Minute
  475. Month
  476. NVI
  477. Name
  478. Now
  479. NumToStr
  480. Nz
  481. OBV
  482. Optimize
  483. OscP
  484. OscV
  485. Outside
  486. PDI
  487. PVI
  488. Param
  489. ParamColor
  490. ParamStr
  491. Peak
  492. PeakBars
  493. Percentile
  494. Plot
  495. PlotForeign
  496. PlotGrid
  497. PlotOHLC
  498. PlotShapes
  499. PlotVAPOverlay
  500. Prec
  501. Prefs
  502. RMI
  503. ROC
  504. RSI
  505. RSIa
  506. RWI
  507. RWIHi
  508. RWILo
  509. Random
  510. Ref
  511. RelStrength
  512. RestorePriceArrays
  513. SAR
  514. Second
  515. SectorID
  516. SelectedValue
  517. SetBarsRequired
  518. SetForeign
  519. SetFormulaName
  520. SetOption
  521. SetTradeDelays
  522. Signal
  523. StDev
  524. Status
  525. StdErr
  526. StochD
  527. StochK
  528. StrExtract
  529. StrFind
  530. StrFormat
  531. StrLeft
  532. StrLen
  533. StrMid
  534. StrRight
  535. StrToNum
  536. Study
  537. Sum
  538. TEMA
  539. TSF
  540. TimeFrameCompress
  541. TimeFrameExpand
  542. TimeFrameGetPrice
  543. TimeFrameRestore
  544. TimeFrameSet
  545. TimeNum
  546. Trin
  547. Trix
  548. Trough
  549. TroughBars
  550. Ultimate
  551. UncIssues
  552. UncVolume
  553. ValueWhen
  554. Version
  555. WMA
  556. Wilders
  557. WriteIf
  558. WriteVal
  559. Year
  560. Zig
  561. _N
  562. _TRACE
  563. abs
  564. acos
  565. atan
  566. ceil
  567. cos
  568. exp
  569. fclose
  570. feof
  571. fgets
  572. floor
  573. fopen
  574. fputs
  575. frac
  576. int
  577. log
  578. log10
  579. printf
  580. round
  581. sign
  582. sin
  583. sqrt
  584. tan
  585. // flow of control statements, variable scope, preprocessor
  586. KeyWords3:
  587. do
  588. else
  589. for
  590. function
  591. global
  592. if
  593. local
  594. procedure
  595. return
  596. while
  597. //////////////////////////////////////////////////////////////////////////////
  598. // string delimiter: StringBegChar - string begin char
  599. // StringEndChar - string end char
  600. // MultilineStrings - enables multiline strings, as perl
  601. // has it
  602. StringBegChar:          "
  603. StringEndChar:          "
  604. MultilineStrings:       0
  605. //////////////////////////////////////////////////////////////////////////////
  606. // use preprocessor: 0 - no
  607. // 1 - yes
  608. // note: if yes, '#' and statements after it will be
  609. // highlighted with Preprocessor defined colors
  610. UsePreprocessor:        1
  611. //////////////////////////////////////////////////////////////////////////////
  612. // highlight line: 0 - no
  613. // 1 - yes
  614. // note: if yes, current line will be highlighted
  615. CurrLineHighlighted:    0
  616. //////////////////////////////////////////////////////////////////////////////
  617. // colors
  618. // note:                first value is foreground, second is background color
  619. //                        and third (optional) represents font attribute:
  620. //                        B - bold
  621. //                        I - italic
  622. //                        U - underline
  623. //                        S - strike out
  624. //                        attributes can be combined: eg. B or BI
  625. //                      as value, it could be used any standard windows color:
  626. //                        clBlack, clMaroon, clGreen, clOlive, clNavy,
  627. //                        clPurple, clTeal, clGray, clSilver, clRed, clLime,
  628. //                        clYellow, clBlue, clFuchsia, clAqua, clLtGray,
  629. //                        clDkGray, clWhite, clScrollBar, clBackground,
  630. //                        clActiveCaption, clInactiveCaption, clMenu, clWindow,
  631. //                        clWindowFrame, clMenuText, clWindowText, clCaptionText,
  632. //                        clActiveBorder, clInactiveBorder, clAppWorkSpace,
  633. //                        clHighlight, clHighlightText, clBtnFace, clBtnShadow,
  634. //                        clGrayText, clBtnText, clInactiveCaptionText,
  635. //                        clBtnHighlight, cl3DDkShadow, cl3DLight, clInfoText,
  636. //                        clInfoBk
  637. //                      as value, it could be used hex numeric constant too:
  638. //                        $BBGGRR - BB: blue, GG: green, RR: red, eg: $FF6A00
  639. SpaceCol:               clWindowText clWindow
  640. Keyword1Col:            clBlack clWindow B
  641. Keyword2Col:            clBlue clWindow
  642. Keyword3Col:            $000080 clWindow B
  643. Keyword4Col:            clBlue clWindow
  644. Keyword5Col:            clBlue clWindow
  645. IdentifierCol:          clWindowText clWindow
  646. CommentCol:             clGreen clWindow
  647. NumberCol:              clFuchsia clWindow
  648. StringCol:              clFuchsia clWindow
  649. SymbolCol:              clBlack clWindow
  650. PreprocessorCol:        $000080 clWindow B
  651. SelectionCol:           clWhite clNavy
  652. CurrentLineCol:         clBlack clYellow