How to maximize trades daily

Questions about MultiCharts and user contributed studies.
gannlover13
Posts: 8
Joined: 15 Aug 2014
Has thanked: 8 times

How to maximize trades daily

Postby gannlover13 » 12 Nov 2014

Hi there,

I like to write in EL a code where I need to maximize the number of trades on daily basis.

I tried SessionStart en SessionEnd, but still no clue.

Anyone any idea how to specify the number of trades a system may do daily?

thx in advance

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: How to maximize trades daily

Postby Andrew MultiCharts » 12 Nov 2014

Hello gannlover13,

There are couple of things limiting number of trades per a bar (thus per a day). First of all i recommend you to read how signals are calculated in MC. The following settings may affect the number of trades:
  1. Position Limits
  2. IOG mode
If those options are configured correcly, the number of orders per 1 day = the number of orders you code generates per the day.

gannlover13
Posts: 8
Joined: 15 Aug 2014
Has thanked: 8 times

Re: How to maximize trades daily

Postby gannlover13 » 12 Nov 2014

Andrew, thanks for quick answer.

I would like to code it myself in an indicator, I have reasons for that. Not in a signal thus.

Example:

The day starts -> from x to y-time n-trades may be done, long/short.
After x trades THAT DAY trading have to stop.

This is what I need in EL-code

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: How to maximize trades daily

Postby Andrew MultiCharts » 12 Nov 2014

Gannlover13,

We can create it for you on paid basis. If you are interested in evalution, please send us a detailed description and requirements for the indicator to support@multicharts.com

You can also try to create it yourself or ask anouther forum users to help you with this.

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: How to maximize trades daily

Postby furytrader » 12 Nov 2014

I'm still not clear what you're trying to do. Are you trying to limit the number of trades done each day during a certain time?

gannlover13
Posts: 8
Joined: 15 Aug 2014
Has thanked: 8 times

Re: How to maximize trades daily

Postby gannlover13 » 12 Nov 2014

@ furytrader,

Yes, I like to maximize the number of trades between certain times daily.

A variable of maxtrades exists and with this variable one could limit the trades.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: How to maximize trades daily

Postby JoshM » 13 Nov 2014

I would like to code it myself in an indicator, I have reasons for that. Not in a signal thus.

Example:

The day starts -> from x to y-time n-trades may be done, long/short.
After x trades THAT DAY trading have to stop.

This is what I need in EL-code
Wouldn't it be easier to have the signal communicate this information to the indicator? That would also solve the issue that an indicator cannot stop trading (unless you trade discretionary, but then it's you who stop and not the indicator :] ).

See I_SetPlotValue and I_GetPlotValue for that.
A variable of maxtrades exists and with this variable one could limit the trades.
I'm not sure if you mean that this `maxtrades` variable holds the current trade count or the treshold that would define the maximum number of trades.

But see TotalTrades for the total number of trades of the signal. This keyword is not accessible in indicator, so you either need to use a global variable or use the above suggestion.

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: How to maximize trades daily

Postby furytrader » 13 Nov 2014

This doesn't have to be too hard, but I don't think this is for an indicator to do. To code it in a signal is pretty straight forward - I'm going to assume that you're working on a 24 hour chart:

Code: Select all

Input: DailyLimit(0);
vars: startNumTrades(0);

If Date > Date[1] Then startNumTrades = TotalTrades;

...

If (totalTrades - startNumTrades) <= dailyLimit Then Begin
<Enter buy logic here>
<Enter sell logic here>
End;
There may be easier ways to code this but, like I said, it's pretty simple.

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

Re: How to maximize trades daily

Postby sptrader » 13 Nov 2014

In easylanguage there is a function called "TradesToday" ...MC should have something equivalent...
If you can get access to it, just write something like:

Code: Select all

If TradesToday <= 5 {trade limit} then begin
enter buy logic here
enter sell logic here
end;

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: How to maximize trades daily

Postby bensat » 13 Nov 2014

As long as there is no function implemented in MC like in TS, he needs the counter for each trade to his maximum trades input. Did not see it here :

Code: Select all

input : i.MaxTrades(5);

var : var.TradesToday(0);


if date <> date[1] then
begin
var.TradesToday = 0;
end;

if (Trade.Condition = 1) and (var.TradesToday <= i.MaxTrades) then
begin
buy/sell ........
var.TradesToday = var.TradesToday + 1;
end;
Hope this makes it more clear and it helps.

My Regards.

Ben

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: How to maximize trades daily

Postby furytrader » 13 Nov 2014

The keyword TotalTrades will tell you the # of total trades closed out since trading started.

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: How to maximize trades daily

Postby bensat » 13 Nov 2014

The keyword TotalTrades will tell you the # of total trades closed out since trading started.
Thank you. I wasn't aware of this keyword.

Regards.

Ben


Return to “MultiCharts”