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?
entriestoday always returns zero
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: entriestoday always returns zero
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.
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.
Re: entriestoday always returns zero
The source code looks like this:
I want to allow only 2 trades per day and it doesn't count...If marketposition = 1 and entriestoday(date) < 2
then Buy ("2nd buy") Next Bar at Market;
- Attachments
-
- pic.jpg
- (89.62 KiB) Downloaded 1024 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: entriestoday always returns zero
What is your chart resolution?The source code looks like this:
I want to allow only 2 trades per day and it doesn't count...If marketposition = 1 and entriestoday(date) < 2
then Buy ("2nd buy") Next Bar at Market;
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: entriestoday always returns zero
That snippet alone can't tell us much...The source code looks like this:I want to allow only 2 trades per day and it doesn't count...If marketposition = 1 and entriestoday(date) < 2
then Buy ("2nd buy") Next Bar at Market;
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: entriestoday always returns zero
I've always used the function "TradesToday(date)"... I don't know if they are identical or not..but it works..
Re: entriestoday always returns zero
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...That snippet alone can't tell us much...
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: entriestoday always returns zero
entriestoday works fine on my computer.and what else do you need? It's just simple condition which isn't working..That snippet alone can't tell us much...
::
...
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: entriestoday always returns zero
as much info as possible.and what else do you need?That snippet alone can't tell us much...
::
...
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?