count trade in week

Questions about MultiCharts and user contributed studies.
Posts: 90
Joined: 02 Sep 2013
Has thanked: 37 times

count trade in week

Postby shivax » 13 Feb 2018

Hi, i want to count trade in week..

Example: i want to trade only 1 once time

User avatar
Anna MultiCharts
Posts: 560
Joined: 14 Jul 2017
Has thanked: 42 times
Been thanked: 136 times

Re: count trade in week

Postby Anna MultiCharts » 15 Feb 2018

Hello, shivax!

In manual trading you can do that by just counting the number of trades yourself or monitoring them in the Order and Position Tracker.
If you need to do that in autotrading, then your strategy should memorize the time of the trades and in case you need more than just one trade a week it should also remember the number of trades that were already done during the specified period. Please refer to the Strategy Position and Strategy Position Trades sections of our Wiki: ... y_Position ... ion_Trades

Posts: 90
Joined: 02 Sep 2013
Has thanked: 37 times

Re: count trade in week

Postby shivax » 15 Feb 2018

hi, anna

and how i code the news week?

i must to know when the next week starts

User avatar
Posts: 166
Joined: 16 Oct 2014
Location: Seattle, USA
Has thanked: 36 times
Been thanked: 73 times

Re: count trade in week

Postby fbertram » 16 Feb 2018

Hi Shivax,

try something along the lines of:

Code: Select all

if DayOfWeeek(DateTime[0]) < DayOfWeek(DateTime[1])) then
// a new week has started
// memorize the total number of trades
end else begin
// we are somewhere in the middle of the week
// trades this week is total number of trades minus the number at the beginning of the week
This should get you pretty close to what you are looking for. Please excuse any typos or other errors, I no longer have an EasyLanguage license available. ... p/DateTime ... e_Routines

Cheers, Felix

Return to “MultiCharts”