How to create an If-Then in Rules?
Author: mjleary
Creation Date: 3/28/2019 5:35 PM
profile picture

mjleary

#1
I’m trying to make a simple conditional IF-THEN statement and this function does not seem to exist...

Ex.:
In a simple weekly situation:
Always do Day 1:
Buy at [entry]
Sell when hits target of X%
{IF it sells on Day 1, THEN do this:}
Day 2:
Buy at [entry]
Sell when hits target of X%

I’ve been trying to use the MC group operation, but it is not always honoring the requirement that only IF Day1 Sells, THEN place order for Day 2. Is there a simple IF -THEN function? I can’t seem to find it if it exists.

Thank you for your help.
profile picture

Eugene

#2
Sorry, conditional entry following an exit is not supported in Rules but you can easily come up with this in code-based Strategy.
profile picture

mjleary

#3
No clue how to code it. Could you add it to this code and let me learn from what you put in? That would be awesome. Thank you!

CODE:
Please log in to see this code.
profile picture

Eugene

#4
Here's an example:

CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).