Time stop in 3 line break charts

Questions about MultiCharts and user contributed studies.
waldem
Posts: 108
Joined: 18 Nov 2013
Has thanked: 3 times
Been thanked: 4 times

Time stop in 3 line break charts

Postby waldem » 02 Oct 2014

Hallo all, i'm writing a system intraday using 3 line break chart.

i'm trying to setup a funcion to close the operation at 17.25 (5 minutes before end in European time) using the following code:

Code: Select all

If time >=SessEnd and Marketposition<0 Then
BuytoCover ("STime") currentshares shares this bar on close;

If time >=SessEnd and Marketposition>0 Then
Sell ("LTime") currentshares shares this bar on close;
The problem is that the "time" function recognize the time at the end of the bar and using the 3 line break if the bar is not close at this time don't work.

i have tried with currenttime to use the computer time, but if you use in chart after the close will generate close of all open trade at second bar..

Have you any suggestion?

User avatar
TJ
Posts: 7192
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 990 times
Been thanked: 2049 times

Re: Time stop in 3 line break charts

Postby TJ » 02 Oct 2014

Hallo all, i'm writing a system intraday using 3 line break chart.

i'm trying to setup a funcion to close the operation at 17.25 (5 minutes before end in European time) using the following code:

Code: Select all

If time >=SessEnd and Marketposition<0 Then
BuytoCover ("STime") currentshares shares this bar on close;

If time >=SessEnd and Marketposition>0 Then
Sell ("LTime") currentshares shares this bar on close;
The problem is that the "time" function recognize the time at the end of the bar and using the 3 line break if the bar is not close at this time don't work.

i have tried with currenttime to use the computer time, but if you use in chart after the close will generate close of all open trade at second bar..

Have you any suggestion?
What is your chart resolution?

What is the value of SessEnd ?

waldem
Posts: 108
Joined: 18 Nov 2013
Has thanked: 3 times
Been thanked: 4 times

Re: Time stop in 3 line break charts

Postby waldem » 03 Oct 2014

hi TJ,
sessend variable is set to 1725, our market close at 1730 local time.

the 3 line break chart is set to 3 line break resolution 2 minute
Attachments
3 line break -2.jpg
3 line break -2.jpg (73.79 KiB) Viewed 475 times

User avatar
TJ
Posts: 7192
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 990 times
Been thanked: 2049 times

Re: Time stop in 3 line break charts

Postby TJ » 03 Oct 2014

ps.
This bar on close
viewtopic.php?f=16&t=10811

User avatar
TJ
Posts: 7192
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 990 times
Been thanked: 2049 times

Re: Time stop in 3 line break charts

Postby TJ » 03 Oct 2014

::
The problem is that the "time" function recognize the time at the end of the bar and using the 3 line break if the bar is not close at this time don't work.
::
Have you any suggestion?
From my experience, non-standard charts are never good for auto-trade/backtest.

If you are having problem with bar close time, then you have to give yourself more time before closing... (especially in a thin market).


Return to “MultiCharts”