1 Off ExitAfter X Bars Translation in MultiCharts

The code translation between SQX and Multicharts of ExitAfter X Bars is 1 off. Trades in MultiCharts take 1 extra bar.

Current Code in MultiCharts powerlanguage:

// ExitAfterBars
    if (18 > 0 and BarsSinceEntry(0) >= 18) then
        Sell("LongExitAfterXBars") next bar at market;
       
Code that produces the same exits (note the comparison operator):

// ExitAfterBars
    if (18 > 0 and BarsSinceEntry(0) > 18) then
        Sell("LongExitAfterXBars") next bar at market;

There are 2 different resulting implementations in Multicharts for this condition:
- First one has raw number in it.
- Second one has a variable named ExitAfterBars
Please make sure both are corrected.

I've attached positions and code comparison snapshots.
Attachments
exitAfterXBars.jpg
(1.25 MiB)
exitAfterXBarsImplementation.jpg
(788.11 KiB)
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

AS
#1

andreis

19.11.2022 16:24

Task created

E
#2

Emmanuel

19.11.2022 17:38
Voted for this task.
g
#3

Lee Guan Chuan

14.02.2023 04:04

Status changed from New to Fixed


Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please