<solved>Can't successfully call a function which has a structure as input
An object has to be passed as parameter.
//structure struct fibLevels { double retrace382; double retrace500; double retrace618; double retrace786; double retrace886; double extension618; double extension1000; double extension1272; double extension1618; }fiblvls; if(iClose(NULL,0,pX)>iClose(NULL,0,pA)) //PROBLEM IS HERE FibLevel(highX, lowA, fiblvls); else FibLevel(lowX, highA, fiblvls);
An object has to be passed as parameter.
FibLevel(highX, lowA, fibLevels); ⋮ //structure struct fibLevels{…};
Struct fibLevels is a definition — think of it as double. FibLevel(highX, lowA, double) makes no sense.
Create a variable of that type and you can pass that. struct fibLevels fiblvls; FibLevel(highX, lowA, fiblvls)
Struct fibLevels is a definition — think of it as double. FibLevel(highX, lowA, double) makes no sense.
Create a variable of that type and you can pass that. struct fibLevels fiblvls; FibLevel(highX, lowA, fiblvls)
wow, thank you! Your explanation is really helpful for a beginner like me (:
Much appreciated sir
Hi,
I have recently started learning coding and can't seem to figure the right way to call the function listed below (the code below is not completed).
Using this code, the function at the bottom lists no errors. However, when calling it in the OnTick block, many many errors start coming up.
Ideally, after calling the function we should have all the values for each fib level.
I'm sure I've made a stupid mistake, which should be easy to spot by experienced coders.
Alternatively, i plan to do the calculations manually (without a function), and have them stored as global variables instead.
Would appreciate any help/ feedback!