What the Code view is for
The Code view lets you review the cTrader code associated with your work and use the generation or compilation actions available. Use it for technical review and export preparation after clarifying strategy rules.
Generation produces a file, compilation checks its construction in the offered context and testing studies behaviour on data. Completing one step does not replace the others.
Prepare generation
- Select the strategy and intended version.
- Save the latest rules and protections.
- Open the technical area and Code tab.
- Use the offered generation or compilation action.
- Wait for its final status and read the messages.
- Review the result before continuing to export.
If the interface shows a limited preview, do not treat it as the complete file. Use the available actions to access the content included in your account’s options.
Distinguish parameters and constants
This C# fragment only illustrates fixed values. It is not a complete trading robot or a description of the code generated for your strategy.
// Teaching example: fixed values in C# code.
const int FastPeriod = 20;
const int SlowPeriod = 50;
// A constant alone is not an interface setting.Inspect the exported file’s parameters and the list presented in cTrader to identify adjustable settings. If an expected value is missing, check the exported version before requesting changes.
Review behaviour-changing elements
| Element | Review question |
|---|---|
| Market and horizon | Do they match the tested project? |
| Entries | Do conditions and direction match Flow? |
| Protections | Are size, stop and target units explicit? |
| Sessions | Which timezone and boundaries apply? |
| Parameters | Which values are exposed and what are their defaults? |
Finding the same number is not enough. Check its unit and purpose: 20 can represent a period, distance or another quantity.
Read compilation messages
A message can identify something missing, an inconsistency or a manual-edit error. Record the exact message and line when shown. Address the first identifiable cause before changing several parts of the file.
Explain this compilation message in the context of the displayed file.
Identify the affected element and suggest a minimal correction.
Preserve strategy rules and protections.
State what needs recompiling and checking afterwards.Successful compilation means that step completed in its context. It does not establish profitability, absence of every logical error or identical results in every operating condition.
Keep a clear working version
Keep the exported file and manual changes identifiable. When regenerating, compare settings before replacing your working copy. Continue with Export to cTrader for file and parameter checks on the target platform.