hendrigani Posted December 27, 2020 Report Share 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 Quote Link to comment Share on other sites More sharing options...
jharris Posted December 28, 2020 Report Share Posted December 28, 2020 Use Name function to get name of the symbol. https://www.amibroker.com/guide/afl/name.html Quote Link to comment Share on other sites More sharing options...
lbf4223 Posted December 28, 2020 Report Share Posted December 28, 2020 You want to look at the documentation for Foreign(), SetForeign() and RestorePriceArrays(). Quote Link to comment Share on other sites More sharing options...
mvssunny Posted December 30, 2020 Report Share 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.