nextpotato
New member
As a novice at coding, I'm struggling to figure out how to implement what is probably a fairly simple feature into my back-testing script.
I would like to tell the script to stop trading for the rest of the day after the first losing trade, and continue trading the next day.
This is kind of how I was planning on implementing it:
1. Compare entry and exit price of the lot.
2. If exit price is lower, flip a "switch" that disables further buying.
3. Reset the "switch" at next market opening.
My problem is I'm not sure how to get the exit price, and how to implement the "switch" in Thinkscript.
I would greatly appreciate it if anyone can point me in the right direction.
I would like to tell the script to stop trading for the rest of the day after the first losing trade, and continue trading the next day.
This is kind of how I was planning on implementing it:
1. Compare entry and exit price of the lot.
2. If exit price is lower, flip a "switch" that disables further buying.
3. Reset the "switch" at next market opening.
My problem is I'm not sure how to get the exit price, and how to implement the "switch" in Thinkscript.
I would greatly appreciate it if anyone can point me in the right direction.