Dear members,
For several times I have seen ProRealTime code that all gave errors. And all these errors I could not explain after looking at these commands in the programming manuals. It starts on the first line: Internal error: unknown command. It is the line with the ‘DEFPARAM’ command: the word ‘CumulateOrders’ is underlined here to indicate that it is not recognized. The same also applies to the commands ‘BUY’ and ‘EXITSHORT’. I can’t possibly figure out why those commands produce such errors. Maybe someone can shed some light on this? I have only added the lines below that give an error.
Defparam CumulateOrders = false
BUY 1 SHARES AT MARKET
EXITSHORT AT MARKET
Internal error: unknown command
Maybe you apply this to Indicator code ? that should not be. This is meant for Strategy code (the rightmost tab at the attempt of selecting/opening the code by means of the editor).
The code you posted reports no errors.
Bear in mind that you can exit long trades using SELL, as EXITSHORT is used to exit short trades opened with SELLSHORT, instead.
Dear Peter,
Thank you very much for your answer. Indeed, I had copied the code into the wrong editor. No more error messages this time. Thank you very much for this tip! Sincerely, Karel.