I appreciate any help with the following. Disregarding the logic of the buying (which is here only for illustrative purposes), I have in the below code three different IF-clauses. The effect I want to achieve is that when one the clauses is fulfilled and a position is entered, it won’t be filled a second time, at least not before it has been sold. But this method doesn’t seem work in PRT. If I run this on any asset intraday, the code doesn’t take any positions at all. If I GRAPH the varible values, I see that SL1, SL2 and SL3 are set to 1 throughout the backtest-period from the first bar. It beats me what’s going on. Any ideas?
probably won’t behave as you want, since you are adding 10 to much lower values which results in a huge number, Say you are buying EurUsd and the CLOSE price il 1.0523, adding 10 to it produces 11.0523, which will NEVER be true!
Try using PIPSIZE to sort it out, as follows:
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue