how to limit # trades per day
how to limit # trades per day
Would like my strategy to only trade the first signal of the day and then ignore any others. Not sure how to set a flag or what keyword(s) I should look at for clues. The strategy works fine as is for the first trade of the day but then continues to trade and I'm not sure how to shut it off after it has made a trade. Thanks
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: how to limit # trades per day
You have to set up a counter.Would like my strategy to only trade the first signal of the day and then ignore any others. Not sure how to set a flag or what keyword(s) I should look at for clues. The strategy works fine as is for the first trade of the day but then continues to trade and I'm not sure how to shut it off after it has made a trade. Thanks
Code: Select all
// this line resets the counter to zero at the beginning of each day
if date > date[1] then
counter = 0;
Code: Select all
if counter = 0 then
begin
if trading_condition = true then
begin
{----- put your order logic here -----}
counter = 1;
end;
end;
HTH
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: how to limit # trades per day
Even easier is the "TradesToday" function.
if TradesToday < 1 then begin
if TradesToday < 1 then begin
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: how to limit # trades per day
TradesToday is not a standard function and is not included in MultiCharts.Even easier is the "TradesToday" function.
if TradesToday < 1 then begin
You can get the code here:
http://www.tradersxchange.com/viewtopic.php?f=31&t=601
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: how to limit # trades per day
* I must have gotten it from TS or Tradersexchange. Sorry, I didn't know that it wasn't included in MC. It's a very handy function.TradesToday is not a standard function and is not included in MultiCharts.Even easier is the "TradesToday" function.
if TradesToday < 1 then begin
You can get the code here:
http://www.tradersxchange.com/viewtopic.php?f=31&t=601