Hi, I would like to create a function (MyPTN) that is formed by different descriptions of patterns/market behaviors. These patterns should be declared as arrays (correct me if I'm wrong) and then define the function MyPTN that retrieves these patters/market behaviors.
Code I came up with:
This is just an idea since I never worked with arrays; at the moment I am getting an error indicating the ">" sign (numerical expression expected here).
The function will be used in a strategy, it should allow me to analyze the different results of the listed PTNs.
Any suggestion is appreciated.
Can you help answer these questions from other members on futures io?
Note sure what system you are using and not a real programmer, but thinking issue may be it's not seeing the boolean expression as a value, so something like:
I really don't know though.
The following user says Thank You to RandomDude for this post:
By reading the EasyLanguage PDF, I think "Function Array parameter declaration" (page 109) is the solution. But again, I never used them, and trying to figure it out, any advice is welcome.
Hi, I would like to create a function (MyPTN) that is formed by different descriptions of patterns/market behaviors. These patterns should be declared as arrays (correct me if I'm wrong) and then define the function MyPTN that retrieves these patters/market behaviors.
Code I came up with:
Array: PTN[10](0), // Indicating 11 arrays from 0 to 10 (?)
numberPTN[10](0);
PTN[1] = Close > Close[1];
PTN[2] = Close < Close[1];
{list can go on}
MyPTN = PTN[numberPTN]; // Function
This is just an idea since I never worked with arrays; at the moment I am getting an error indicating the ">" sign (numerical expression expected here).
The function will be used in a strategy, it should allow me to analyze the different results of the listed PTNs.
Any suggestion is appreciated.
Current possible solution but still get an error:
// Boolean function MyPTN
inputs:
PatternNumber(numericsimple);
arrays:
Patterns[10](false);
// List of patterns
Patterns[1] = Close > Close[1];
Patterns[2] = Close < Close[1];
{rest of the list}
MyPTN = Patterns[PatternNumber];
The error is in the function MyPTN = Patterns[PatternNumber] "Numerical expression expected here" ("Patterns" is highlighted).