Hi,
is it possible to add an entry condition depending on how the market moves? For example: if the S&P500 is aproaching its highest High of the last 40 day (5% below), use Close> EMA40 as a further filter for the stocks. If the market is still far away from its highest high (more than 5% below), trade without Close>EMA40. The intention is to pick up only the strong stocks in the highest High area.
Thank you again
Best
Niels
Size:
Color:
Yes it's possible. If you still haven't reviewed QuickRef (GetExternalSymbol) / WealthScript Programming Guide (DataSeries >
Accessing Secondary Symbols), it's about time.
Note: takes at least 120 bars of data to be loaded (for the whys and whereabouts please refer to the WS Guide > Indicators >
Stability of Indicators).
CODE:
Please log in to see this code.
Size:
Color:
Hi Eugene,
Thanks a lot for the code. But I think the bool condition should be as following:
CODE:
Please log in to see this code.
The EMA40 ought to be used additionally as an entry condition if extHigh[bar] is within the area of market reprieve. Am I wrong?
Best
Niels
Size:
Color:
QUOTE:
But I think the bool condition should be as following:
That's right Niels. Typo has been corrected. Thanks.
QUOTE:
The EMA40 ought to be used additionally as an entry condition if extHigh[bar] is within the area of market reprieve. Am I wrong?
This is what the code is doing.
Size:
Color: