I am having trouble with SplitPosition and obviously do not understand how it works.
Here is some code that works ok and executes exit condition xrsi_1 but never executes exit condition xrsi_2. After selling 50% of my position with xrsi_1, I expected when xrsi_2 is met the other 50% would be sold but this never happens.
Any ideas what I'm doing wrong?
Note: I scale my displays differently so rsi conditions look odd but correspond to standard values.
CODE:
Please log in to see this code.
Size:
Color:
This happens because you keep treating the system as a single-position one...
CODE:
Please log in to see this code.
...while it creates two positions with SplitPosition.
Try this example:
CODE:
Please log in to see this code.
Note: this is really looking nonsensical as RSI can't go below zero:
CODE:
Please log in to see this code.
Size:
Color:
Eugene,
Thanks, I'll take a closer look at your example.
With regard to rsi negative. I find it easier to compare all indicators if they are scaled about zero. I always scale all my indicators around the zero line, hence the negative value.
Size:
Color: