Hi all,
I want that my strategy only takes Stocks between 10$ and 100$. Buy no Stock under 10 $ or over 100 $. How can I enter this in the code?
Size:
Color:
Just add this extra condition at the top of your entry logic. If a stock's price is too low or too high, this statement will simply skip the rest of the logic and
continue to the next bar.
CODE:
Please log in to see this code.
There's no problem doing this as a filter for live trading, however, I would caution you that using such a condition for backtesting is "peeking" since it doesn't take into account splits that may occur in the future. In this case, there's another technique to use to make this test against the "unadjusted" series.
Size:
Color:
CODE:
Please log in to see this code.
Size:
Color: