The problem with that is that it is just buying additional shares at the 
beginning of the month as opposed to only taking new signals once per month.  
Also, my script uses sigScaleIn as well.  So I do not think I can use this to 
accomplish what I am after.

Thank you for the help though.  Of course, if I am wrong, I would love to have 
some additional help.

Kind regards.

--- In [email protected], "longt3rm" <longt...@...> wrote:
>
> Not sure if this helps, it is for scaling in by month:
> Example 2: dollar&#8722;cost averaging
> (simplified formula because AB treats first sigScaleIn as buy anyway)
> FixedDollarAmount = 500;
> MonthBegin = Month() != Ref( Month(), &#8722;1 );
> FirstPurchase = Cum( MonthBegin ) == 1;
> Buy = IIf( MonthBegin, sigScaleIn, 0 ); // each month increase position
> Sell = 0; // we do not sell
> PositionSize = FixedDollarAmount;
> 
> page: 172 of the users guide; just read it in the last week...
> 
> --- In [email protected], "readshark" <readshark@> 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/[email protected]/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);
> > }
> >
>


Reply via email to