I'm hoping to use R to retrieve, clean and manipulate data then pass on results to AB for backtesting.
I've read the 2018 forum post (calling 32bit R, no multi threading). As a lark and alternatives perhaps .. i asked chatGPT how to call R from AB (response below). I haven't been up to date on AB releases but I couldn;t find "RCall" in this forum. was chatgpt making it up? if not please point me to the relevant documentation, thanks
"To call an R script from Amibroker, you can use the AmiBroker's AFL (AmiBroker Formula Language) scripting language. The AFL language provides a built-in function called "RCall" that allows you to execute R scripts and pass data between AmiBroker and R. Here's an example of how you can call an R script from Amibroker:
- First, make sure you have R installed on your system.
- In AmiBroker, open the Formula Editor by clicking on the "Analysis" menu and selecting "Formula Editor."
- In the Formula Editor, write the following AFL code to call the R script:
#include <RCall.amx> rInit(); // Execute R script rExecute("path_to_your_r_script.R"); // Example of passing data from AmiBroker to R rSet("amibroker_data", your_amibroker_data_array); // Example of retrieving data from R to AmiBroker rGet("r_variable_name", your_amibroker_variable_array); rEnd();