hendrigani Posted December 27, 2020 Report Posted December 27, 2020 Hi all, I want to make afl code which is consist of 2 parameters for different symbols in 1 AFL. for example: symbol A Cross(MA(C,5),MA(C,20)) symbol B Cross(MA(C,20),MA(C,60)) Anyone who can help me would be appreciate
jharris Posted December 28, 2020 Report Posted December 28, 2020 Use Name function to get name of the symbol. https://www.amibroker.com/guide/afl/name.html
lbf4223 Posted December 28, 2020 Report Posted December 28, 2020 You want to look at the documentation for Foreign(), SetForeign() and RestorePriceArrays().
mvssunny Posted December 30, 2020 Report Posted December 30, 2020 Not much of a computer literate. but here is the code I made of Relative Performance. This is how i use 2 symbols .. Edit as per ur need... _SECTION_BEGIN("RelPerformance to Index"); _N( IndexSymbol= ParamStr("IndexSymbol", "NIFTY") ); SetForeign(IndexSymbol); IndexClose = Close; RestorePriceArrays(); _SECTION_END(); _SECTION_BEGIN("Sy"); SymbolClose = Close; _SECTION_END(); RelPerformance = SymbolClose / IndexClose ; Plot( RelPerformance, "RelPerformance to Index", ParamColor( "Color", colorCycle ), styleThick ); /// ⭐ option trader 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now