For backtests and alerts, I would like to be able to eliminate or skip or avoid signal names below a priority number, say 5 or whatever, or a variable.
How can I do so for the code below? Thanks very much.
CODE:
Please log in to see this code.
Size:
Color:
Is it a simple mathematical operation of comparing the priority variable with some arbitrary number?
Size:
Color:
Yes, that should do it. But here in WL5 code, I do not know where or how to insert the simple but necessary language. Sorry for my elementary grade status and 'fear of coding' like a deer frozen in the middle of the road.
maybe something somewhere in the nature of, "if (priority > 5, BuyAtMarket( bar+1);" ?
so the last two lines would become
CODE:
Please log in to see this code.
?
Size:
Color:
The strategy being referenced is either the 33 Liner, the seventeen liner or that family group of strategies.
Size:
Color:
CODE:
Please log in to see this code.
Trnaslation: The Position priority value is priority - i. So, only if priority-i is greater than 5 will the BuyAtMarket function be executed.
Size:
Color:
I tried the above change, it does not work.
Priority is not assigned until after the buy conditions segment, so is there a need for a goto jump or loopback reference to modify the buy at market by the subsequent priority calculation?
Size:
Color:
Of course it works. The priority - i is value known before the position is created as I explained already.
Size:
Color:
Apology. I did not refresh the page and did not see your response and code. I was saying my noted code does not work.
Size:
Color:
Yes, it is working fine. Thank you Cone for your help.
Size:
Color: