Hi,
I use a macro (MSWord) to compilate my *.afl.
You could write this macro into a Word module and adapt your path.
It takes a moment to create the links and the contents table, be
patient. Up to your computer.
After you can use the power of Word to search an occurence or anything.
I run it from time to time to update.
Best regards
Option Explicit
Sub TestImport()
'Import "C:\Program Files\AmiBroker\ Formulas\ Equity", "*.afl"
Import "C:\Program Files\AmiBroker\ Formulas\ Custom", "*.afl"
End Sub
Sub Import(FileName As String, FileLook As String)
'
' FileName = Chemin ex : c:\MesDocuments
' FileLook = Fichier recherché ex : *.txt
'
Dim fs As Object
Dim i As Integer, NumFic As Integer, A As String
Dim MyText As String
Set fs = Application. FileSearch
With fs
.LookIn = FileName
.FileName = FileLook
If .Execute(SortBy: =msoSortByFileNa me,
SortOrder:=msoSortO rderAscending) > 0 Then
Selection.InsertBre ak Type:=wdPageBreak ' Insère une
page pour la table des matières
For i = 1 To .FoundFiles. Count
With Selection
.Style = ActiveDocument. Styles("Titre" )
.TypeText (fs.FoundFiles( i))
.TypeParagraph
.InsertFile FileName:=fs. FoundFiles( i), Range:="",
ConfirmConversions: =False, Link:=False, Attachment:= False
.EndKey Unit:=wdStory
If i < fs.FoundFiles. Count Then .InsertBreak
Type:=wdPageBreak
End With
Close #NumFic
Next i
End If
End With
Selection.HomeKey Unit:=wdStory
'
' Table des matières
'
With ActiveDocument
.TablesOfContents. Add Range:=Selection. Range,
RightAlignPageNumbe rs:= _
True, UseHeadingStyles: =True,
UpperHeadingLevel: =1, _
LowerHeadingLevel: =3,
IncludePageNumbers: =True, AddedStyles: ="", _
UseHyperlinks: =True,
HidePageNumbersInWe b:=True
.TablesOfContents( 1).TabLeader = wdTabLeaderDots
.TablesOfContents. Format = wdIndexIndent
End With
End Sub
ics4mer a écrit :
>
>
>
>
> Hi all,
>
> Just wondering how people out there are organising their
> AFL code between plots, backtests, explorations etc.
>
> Lets say I have 5 indicators which each require 50 lines
> of code to draw a plot, in other words too large to
> maintain in separate AFL files.
>
> Lets say I also want them all in a single exploration.
>
> So logically it seems that I should place each indicator
> into an include file and include that into each of the AFL
> "types" so I'd have "include <myTA_Tool.h> " in my b_backtest,
> e_exploration, and p_plot files?
>
> Just wondering how everybody else is handling this?
>
> RZ
>
>