Welcome to the forums.
When you run a screener in the Strategy Monitor, you're breaking the link between the historical positions and the alerts.
IsLastPositionActive will always be
false because a Position does not have a chance to be established since by turning the strategy into a screener it's not processing history. Only the entry Alerts will be generated, and Alerts will disappear because the Strategy will not re-create them for the most recent bar.
If your intention is to get only the entry Alerts, simply leave only that part of the code. This should do it for a screener:
CODE:
Please log in to see this code.
QUOTE:
2) Does a screener per the suggested code need to be run by the end of Day or can it be ran as a live steam ?
This particular strategy is end-of-day since gaps are inherently an EOD thing.
P.S. Please do not use external image hosters. They are used to die away regularly, leaving the topics with orphaned image links. Simply attach your images straight before making a post by clicking "Add attachments" and then clicking "Post". It's that simple.
Once post is published, you can edit it to insert the URL between a pair of IMG tags.