KnitPkg Directives
The entrypoint source file and the @knitpkg:include directives¶
As we already know, the entrypoint source file is src/KnitPkgSMA.mqh. Inside it, you can see special KnitPkg directives:
| src/KnitPkgSMA.mqh | |
|---|---|
Those @knitpkg:include directives are the missing link: they point to headers that live outside the current repo, inside dependencies.
About KnitPkg directives (@knitpkg:*)
KnitPkg directives are written inside /* ... */ comment blocks on purpose. They are not part of standard MQL, so the source file must remain valid MQL. During kp install, KnitPkg scans these comment annotations and uses them to resolve and materialize external headers from your dependencies.
Important: KnitPkg only recognizes a directive when it is the only thing on the line. If there is anything before the opening /* or anything after the closing */, KnitPkg will not recognize that directive.