Strange second consecutive trigger opens a second unwanted position

Questions about MultiCharts and user contributed studies.
auato
Posts: 89
Joined: 23 Nov 2016
Has thanked: 18 times

Strange second consecutive trigger opens a second unwanted position

Postby auato » 05 Mar 2020

What is happening is a double consecutive trigger and accordingly a second unwanted position when I use the function "time". You can notice it looking at the attached picture. The first trade is correct but the second one is a not wanted trade as the code is as following:

Code: Select all

if marketposition = 0 and (time=905 or time=1300 or time=1700) then sellshort ("S") 1 contracts next bar at market;
No IOG is enabled. It sounds like the first ticks of the next 5-minute bar, that is the bar 9:10, are still upon the bar 905, can it be possible? I am using IB.
When the trade takes more time and more than one bar, it seems that the fault does not occur.

Any idea?
Thank you
Attachments
strangecase.jpg
(107.18 KiB) Not downloaded yet

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Strange second consecutive trigger opens a second unwanted position

Postby TJ » 05 Mar 2020

MultiCharts version? release number?

auato
Posts: 89
Joined: 23 Nov 2016
Has thanked: 18 times

Re: Strange second consecutive trigger opens a second unwanted position

Postby auato » 06 Mar 2020

hi TJ,
Version: MultiCharts64 Version 12.0 Release (Build 19562)


Return to “MultiCharts”