Hi, I would like to use Onmarket or longtomarket in proscreener.
How can I do it?
Thanks in advance
A screener is just a check that conditions have been met on a list of instruments. You cannot be on market unless you simulate a strategy and then use the conditions to decide whether that simulated strategy would have been on a market or not on a market at any moment in time. Not sure why you would want to though?
Thanks for your answer.
It is a sccreener that check some conditions in order to close positions if you are on the market, so I would like the screener only in the ONmarket.
I’m not big on screeners but perhaps you could code an indicator that simulates your strategy and returns a flag that is 1 or zero if on or off the market. Then CALL the indicator from your screener and use the flag value as a condition to be met.
Perfect, Good Idea. I will try to do. I’ll post the solution.
Hi,
I have tried tje indicator with no luck; I can not use the onmarket instruction in the indicator. So, I can not check when the product is on market.
You don’t use ONMARKET in the indicator. Something more like this is what I was suggesting:
if flag = 0 and (my entry conditions) then
flag = 1
endif
if flag = 1 and (my exit conditions) then
flag = 0
endif
return flag
Thank you very much. The entry conditions are not possible to code. The entry takes into account some conditions but the I decide depending on fundamentals if the entry is valid or not. So I can not code it.
The entry takes into account some conditions but the I decide depending on fundamentals if the entry is valid or not. So I can not code it.
Sorry to hear that as it was an interesting new idea having a screener screen for exits rather than entries. Maybe an idea for another strategy at another time!
The only idea that I found is creating a list with the products that are on market and then the screener will check only onmarket list.
It implies a manual job but It is the best I found.
Any other solution will be appreciatted,
If your conditions can be set up using the IG Indicator Alert then you may be able to achieve a compromise solution?
I often used the IG Alert on my phone when manual trading and away from my PC screen, even when going to the toilet! 🙂