entriestoday always returns zero

Questions about MultiCharts and user contributed studies.
snuff
Posts: 6
Joined: 21 Jul 2013
Been thanked: 1 time

entriestoday always returns zero

Postby snuff » 25 Jul 2013

Hello, I noticed that function EntriesToday(date) always returns zero..And I've read it from a lot of users...

http://www.multicharts.com/discussion/v ... day#p49532

etc.Any suggestions please?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: entriestoday always returns zero

Postby Henry MultiСharts » 31 Jul 2013

Hello snuff,

How exactly do you utilize it? I have tested it in our environment and it returns expected values.
It works for both realtime and backtesting. There should be some orders opening positions generated by the srategy so that EntriesToday(date) can count and return them.

snuff
Posts: 6
Joined: 21 Jul 2013
Been thanked: 1 time

Re: entriestoday always returns zero

Postby snuff » 03 Aug 2013

The source code looks like this:
If marketposition = 1 and entriestoday(date) < 2
then Buy ("2nd buy") Next Bar at Market;
I want to allow only 2 trades per day and it doesn't count...
Attachments
pic.jpg
(89.62 KiB) Downloaded 1024 times

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

Re: entriestoday always returns zero

Postby TJ » 03 Aug 2013

The source code looks like this:
If marketposition = 1 and entriestoday(date) < 2
then Buy ("2nd buy") Next Bar at Market;
I want to allow only 2 trades per day and it doesn't count...
What is your chart resolution?

snuff
Posts: 6
Joined: 21 Jul 2013
Been thanked: 1 time

Re: entriestoday always returns zero

Postby snuff » 03 Aug 2013

15 minutes...

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

Re: entriestoday always returns zero

Postby TJ » 03 Aug 2013

The source code looks like this:
If marketposition = 1 and entriestoday(date) < 2
then Buy ("2nd buy") Next Bar at Market;
I want to allow only 2 trades per day and it doesn't count...
That snippet alone can't tell us much...

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: entriestoday always returns zero

Postby sptrader » 03 Aug 2013

I've always used the function "TradesToday(date)"... I don't know if they are identical or not..but it works..

snuff
Posts: 6
Joined: 21 Jul 2013
Been thanked: 1 time

Re: entriestoday always returns zero

Postby snuff » 04 Aug 2013

That snippet alone can't tell us much...
and what else do you need? It's just simple condition which isn't working.. Btw. I found out that the value which function entriestoday(date) returns is 0 if no trade is made, 1 if one trade is made and in next trades the value 1 doesn't change.. So If signal makes 2 and more trades per day it still returns 1...

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

Re: entriestoday always returns zero

Postby TJ » 04 Aug 2013

That snippet alone can't tell us much...
and what else do you need? It's just simple condition which isn't working..
::
...
entriestoday works fine on my computer.

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

Re: entriestoday always returns zero

Postby TJ » 04 Aug 2013

That snippet alone can't tell us much...
and what else do you need?
::
...
as much info as possible.

who is your broker?
what is the instrument?
what is the session time for the instrument?
are you experiencing the same 0 result for all instruments and all strategies?
a snippet is not enough, the rest of the code could impact your results.
can you post a print out of the trades that shows entriestoday is in error?
a screenshot of the trades affected?
... etc., (what else have you done?)

have you tried to use simple logic?
ie. using entriestoday alone without another condition?

have you used print to trace your variables?


Return to “MultiCharts”