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

金融证券系统

开发平台:

Others

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