[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: One Trade per Month


  • Date: Fri, 19 Feb 2010 22:23:12 -0000
  • From: "Mike" <sfclimbers@xxxxxxxxx>
  • Subject: [amibroker] Re: One Trade per Month

PureBytes Links

Trading Reference Links

Weekly:

weekDays = DayOfWeek();
newWeek = weekDays < Ref(weekDays, -1);

Monthly:

months = Month();
newMonth = months != Ref(months, -1);

Mike

--- In amibroker@xxxxxxxxxxxxxxx, "readshark" <readshark@xxx> wrote:
>
> I am looking to add some code to one of my trading systems to limit the number of trades to x amount per week.
> 
> I found a code that here that would limit the trades to one per day.  Any idea how I alter this to only get one trade on a longer time frame, preferably a week?
> 
> Thank you in advance.
> 
> Here is the link and the code I found. -> http://www.mail-archive.com/amibroker@xxxxxxxxxxxxxxx/msg23006.html
> 
> for (i = 0; i < BarCount; i++)
> {
>     if (newDay[i])
>         hadTradeToday = False;
>     for (sig = bo.GetFirstSignal(i); sig; sig = bo.GetNextSignal(i))
>     {
>         if (sig.IsEntry() && sig.IsLong())
>         {
>             if (hadTradeToday)
>                 sig.PosSize = 0;
>             else
>                 hadTradeToday = True;
>         }
>     }
>     bo.ProcessTradeSignals(i);
> }
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/