I am trying to code in PRT and when backtesting it is not giving the desired results, as it is NOT buying at the TargetPrice, seems I am not getting it right.
Attached screenshot for reference, where the condition met at Bar 1583 with my TargetPrice to buy at 14737.2, but it is bought at Bar 1585 at a price 14816.5.
My TargetPrice and CloseReferencePrice are also changing for each bar, and BuyBar and CurrentBar are also the same when the code runs for backtesting.
Could please advise how this should be done i.e. Buying at the TargetPrice within the next 5 bars when the C1 condition is met, with the below script:
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