Limit number of trades per day (Algo)  [SOLVED]

Questions about MultiCharts and user contributed studies.
stefanols
Posts: 51
Joined: 01 Jan 2014
Has thanked: 14 times
Been thanked: 2 times

Limit number of trades per day (Algo)

Postby stefanols » 01 May 2015

Hi,
How can I limit to number of trades for signal in autotrading.

For instance I just want it to take 10 trades.

I found this code but can not make it work:

vars:
nbrtradestoday (0);

if date <> date[1] then begin

nbrtradestoday = 0;

end;

if MarketPosition <> 0 and MarketPosition[1] = 0 then nbrtradestoday += 1;

if nbrtradestoday >= 1 then #return;

Thanks in advance!

BR Stefan

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 123 times

Re: Limit number of trades per day (Algo)  [SOLVED]

Postby evdl » 01 May 2015

Try this:

Code: Select all

Inputs: max_trades(2); // for example max of 2 trades a day

If (EntriesToday(date) < max_trades) then begin

your entry code

end;

faraz
Posts: 144
Joined: 25 Feb 2011
Has thanked: 26 times
Been thanked: 57 times

Re: Limit number of trades per day (Algo)

Postby faraz » 07 May 2015

This will work as well;

Code: Select all

input: MaxTrades(1);
If tradestoday(d)<MaxTrades then begin
// your code here
End;


Return to “MultiCharts”