Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I'm trying to prevent my code to re-short after it takes a win. If it takes a loss (stop out at high of day), I want it to re-short once more. So max 2 attempts each day.
The code now will re-short even if it takes a win, and it will re-short base on the criteria.
What I try to do, is to have a condition that says that if the grossloss>=0 (which means it haven't covered the position, OR it have taken a loss) and total number of entries are less or equal to 2 then it can short. This means that if the position is covered at 1 vwap deviation, which means a win, no more shorts should be taken, and if it didn't covered, and the stock made a new high, then it would take a loss, and make a new short when the other condition is met.
However, as seen in the image above, it re-short right after a win, which it shouldn't
Can you help answer these questions from other members on NexusFi?
Your strategy is too complicated, I didn't take a closer look and it's not easy to change it.
You need to define two variables, one to track the number of failed trades and one to track the number of successful trades.
Stop trading if you lose twice and stop trading if you win once.