if ((CountIf(delegate {return conditionA;}, 100) >=1) && Open[0]>= Swing(5).SwingHigh[0])
{
EnterLong(DefaultQuantity, "entry1");
By words: "If during last 100 bars conditionA appears, Enter Long everytime Open[0] >= last SwingHigh."
Problem is, that I do not want to enter long above every new SwingHigh made, since conditionA appeared, but I want to enter above the concrete value of only one SwingHigh, which is last Swinghigh before conditionA appeareaed.
Example:
1.Lets say last SwingHigh before conditionA was met was =50.
2. condition A appearred and Open[0] >= 50 -> EnterLong
3. Price goes above value of 50 and makes new Swinghighs ( for example 60) ....But I want my Entry signal only if Open[0] >= 50 (not if Open [0] >= 60)
I was thinking about using function Most recent occurrence, but do not know how to make this condition working. Can you please help me with this problem, how to combine function CounIf and MRO? Or any other way? Thanks a lot... I read about Countif, I red about MRO, but do not know how to combine it.
Comment