First strategy buys only on the whole number and the second one buys only if close finishes with x.50$. Hence, I have 2 entryprices, one at 11$ and the other at 10.5$.(for example)
The main problem here is when I want to sell at 1$ profit. The system recognizes 1$ profit on the 11$ entryprice, but not on the 10.5$. It will sell both shares at the same time when close > 12$. I want to be able to sell at 11.5$ for the one I bought at 10.5$.
Code: Select all
if close>IntPortion(close)+0.01 and close<Intportion(close)+0.99 then
buy ("buy") next bar at IntPortion(close) limit;
if close > entryprice+1 then
sell ("1$") this bar on close;
Code: Select all
if close>IntPortion(close)+0.51 and close<Intportion(close)+0.99 then
buy ("buy_50") next bar at IntPortion(close)+0.5 limit;
if close > entryprice+1 then
sell ("1$!") this bar on close;