Hi Graham,

I'd like to thank you for your time.  I know this may be time-consuming, and
so far I have been further than I expected to go and even if I am not 100%
sure this thing work it seems promising and I will try to make it work.

Thanks,

Louis

2008/6/21 Louis Préfontaine <[EMAIL PROTECTED]>:

> Hi Graham,
>
> Thank you again for your help.
>
> I was not sure what to plot exactly and how to plot it, so I tried
> something else.  I used 15-minute bars to set RSI so it would barely get
> over 70 so I would get a signal in 15-minute time frame and NOT in 5-minute
> timeframe.
>
> Here is my code:
>
> SetTradeDelays( 1, 1, 1, 1 );
>
> TimeFrameSet( in15Minute);
> test = RSI(81)>70;
> TimeFrameRestore();
> test2 = TimeFrameExpand(test, in15Minute,expandLast);
>
> Buy = test2;
> Sell=...;
> BuyPrice = C;
>
> What I expected to see was a signal because the close of the 15-minute bar
> at a particular bar has a RSI(81)>70, but there is no signal at all..  At
> 3:55 PM on the Close of the 15-minute bar I see a RSI(81) of 70.28.  Of
> course the 5-minute RSI is much lower.  So if the code was good, AB should
> treat this RSI has been over 70 because the timeframe has been set in
> 15-minute bars, right?  This is why I believe something must be wrong with
> that code.  But what?
>
> Thank you very much.  I really appreciate your help!
>
> Louis
>
>
>
> 2008/6/20 Graham <[EMAIL PROTECTED]>:
>
>   buyprice = c;
>> will give you the value of close price on the bar of entry. This
>> depends on how you define the buy conditions, expand first or last,
>> trade delays.
>>
>> suggest you plot the expanded indicators or conditions to see what
>> bars they occur on to give you the trade signals.
>>
>>
>> --
>> Cheers
>> Graham Kav
>> AFL Writing Service
>> http://www.aflwriting.com
>>
>> 2008/6/21 Louis Préfontaine <[EMAIL PROTECTED]<rockprog80%40gmail.com>
>> >:
>> > Hi Graham,
>> >
>> > I think it works! I don't know why it didn't work previously, but thanks
>> a
>> > lot for your help and your patience!
>> >
>> > A last question: how would you set the buyprice to be the 5-minute close
>> > AFTER the 15-minute signal?
>> >
>> > TimeFrameSet( in15Minute);
>> >
>> > test = c>...
>> >
>> > TimeFrameRestore();
>> >
>> > test2 = TimeFrameExpand(test, in15Minute);
>> >
>> > Buy = test2;
>> > Sell=...;
>> >
>> > BuyPrice = ?
>> >
>> > I tried Buyprice= Ref (C,1) thinking I would get the 5-minute close
>> after
>> > the 15-minute signal, but it didn't work. I read all the section about
>> > timeframe in the manual, but still couldn't find how to do it. What
>> would
>> > you do in that situation?
>> >
>> > Thank you again for your precious help!
>> >
>> > Louis
>> >
>> >
>> >
>> >
>> >
>> > 2008/6/20 Graham <[EMAIL PROTECTED] <kavemanperth%40gmail.com>>:
>> >>
>> >> see the help files for how to do timeframe functions
>> >> TimeFrameSet(in15minute)
>> >> YourConditionsHere = Whatever;
>> >> TimeFrameRestore();
>> >>
>> >> YourConditionsHere = TimeFrameExpand( YourConditionsHere, in5Minute);
>> >>
>> >> --
>> >> Cheers
>> >> Graham Kav
>> >> AFL Writing Service
>> >> http://www.aflwriting.com
>> >>
>> >> 2008/6/21 Louis Préfontaine <[EMAIL PROTECTED]<rockprog80%40gmail.com>
>> >:
>> >> > Hi Graham,
>> >> >
>> >> > If I understand what you mean is that if I want to simply add a
>> 5-minute
>> >> > bar
>> >> > limitation I need to set timeframe manually for 15-minute bars for
>> each
>> >> > and
>> >> > every rules/signals?
>> >> >
>> >> > But any way you see this, how would you personnaly do to do what I
>> want
>> >> > to
>> >> > do? I mean: I can use 5-minute, 15-minute or even 1-minute bars, but
>> I
>> >> > want
>> >> > to trade only 15-minute bars and use one 5-minute bar simply to set
>> my
>> >> > buying/selling price. How would you do that?
>> >> >
>> >> > Thank you,
>> >> >
>> >> > Louis
>> >> >
>> >> > 2008/6/20 Graham <[EMAIL PROTECTED] <kavemanperth%40gmail.com>
>> >:
>> >> >>
>> >> >> we are not referring to the database time period, but the chart
>> period
>> >> >> being used
>> >> >> you cannot calculate values of a shorter bar period than the chart
>> (or
>> >> >> AA)
>> >> >> The only limitation your database period is that you cannot get 1
>> >> >> minute bars from 5 minute database
>> >> >> The charts are the same, you cannot get 5 minute bar from 15 minute
>> >> >> chart
>> >> >>
>> >> >> --
>> >> >>
>> >> >> Cheers
>> >> >> Graham Kav
>> >> >> AFL Writing Service
>> >> >> http://www.aflwriting.com
>> >> >>
>> >> >> 2008/6/21 Louis Préfontaine <[EMAIL PROTECTED]<rockprog80%40gmail.com>
>> >:
>> >> >> > Hi Barry,
>> >> >> >
>> >> >> > Thank you for your reply. This is a tough nut to crack for me.
>> >> >> >
>> >> >> > I am using 5-minute bars in my database, so this shouldn't be a
>> >> >> > problem.
>> >> >> >
>> >> >> > I want to look ahead for this particular reason: I want to set the
>> >> >> > buyprice
>> >> >> > at the close of the first 5-minute bar out of the next 15-minute
>> bar.
>> >> >> > If
>> >> >> > I
>> >> >> > have a signal at 10:00, I want the price to be the close at 10:00.
>> I
>> >> >> > understand that I must work in 5-minute bars to do this because I
>> >> >> > can't
>> >> >> > go
>> >> >> > from 15 to 5 but only from 5 to 15, but does it mean I would have
>> to
>> >> >> > compress all my data because everything else is based on 15-minute
>> >> >> > bars?
>> >> >> >
>> >> >> > The Buy>1.45 and Sell<50 is simply to see if the code works. Of
>> >> >> > course
>> >> >> > it
>> >> >> > would give me signals everywhere, but I want to see if the signals
>> >> >> > are
>> >> >> > at
>> >> >> > the right place. Right now, it simply does not work at all.
>> >> >> >
>> >> >> > I tried this, based on your own formula, butit still isn't it:
>> >> >> >
>> >> >> >
>> >> >> > TimeFrameSet( in15Minute);
>> >> >> >
>> >> >> > test = C>2;
>> >> >> >
>> >> >> > TimeFrameRestore();
>> >> >> >
>> >> >> > test2 = TimeFrameExpand(test, in15Minute);
>> >> >> >
>> >> >> > Buy = test2;
>> >> >> > Sell=C>10;
>> >> >> >
>> >> >> > I'm really confused. All I want to do is to be able to work with
>> >> >> > 15-minute
>> >> >> > bars and set a buyprice at 5-minute bar Close after the signal. If
>> I
>> >> >> > need
>> >> >> > to set the periodicity to 5-minute bars and compress each and
>> every
>> >> >> > signal
>> >> >> > to 15-minute, I'll do it. But I don't know how to do it,
>> >> >> > unfortunately,
>> >> >> > even after reading all the timeframe section in the manual...
>> >> >> >
>> >> >> > Thank you for your help,
>> >> >> >
>> >> >> > Louis
>> >> >> >
>> >> >> >
>> >> >> > 2008/6/20 Barry Scarborough <[EMAIL 
>> >> >> > PROTECTED]<razzbarry%40imageview.us>
>> >:
>> >> >> >>
>> >> >> >> Graham is correct. You have to use a chart of the shortest
>> >> >> >> timeframe.
>> >> >> >> If you want to show 5 and 15 minute data you will have to plot it
>> on
>> >> >> >> a 5 minute chart. You cannot plot 5 minute bars on a 15 minute
>> >> >> >> chart.
>> >> >> >>
>> >> >> >> I use something like this so I can switch between charts without
>> >> >> >> having to change the code. The example assumes the longer period
>> is
>> >> >> >> three times the chart interval. It calculates a MACD and Stoch in
>> a
>> >> >> >> timeframe 3 times the current chart interval.
>> >> >> >>
>> >> >> >> // Timeframe calculations
>> >> >> >> tf = Interval() / 60; // interval is in seconds
>> >> >> >> tfp = tf * 180; // chart interval * 3 * 60seconds
>> >> >> >>
>> >> >> >> TimeFrameSet(tfp);
>> >> >> >> MacdTf = MACD(r1, r2);
>> >> >> >> tfStoch = StochK( StoPer, Kper);
>> >> >> >> TimeFrameRestore();
>> >> >> >>
>> >> >> >> MacdTfe = TimeFrameExpand(MacdTf, tfp);
>> >> >> >> tfeStoch = TimeFrameExpand(tfStoch, tfp);
>> >> >> >>
>> >> >> >> plot it as usual but expect to see the 15 minute plot to be flat
>> for
>> >> >> >> three 5 min bars. The current bar can change but the previous
>> lines
>> >> >> >> will be flat for three bars for each 15 minute period.
>> >> >> >>
>> >> >> >> This part of you code doesn't make sense:
>> >> >> >>
>> >> >> >> > C5=Ref (C,1); this is looking ahead 1 bar. Is that what you
>> want
>> >> >> >> > to
>> >> >> >> do? You can do that but not from the current bar. And your other
>> >> >> >> calculation is not looking from a previous period. That will give
>> >> >> >> unexpected results.
>> >> >> >>
>> >> >> >> > BuyPrice = TimeFrameExpand (C5,in5Minute);
>> >> >> >> > Buy = C>1.45;
>> >> >> >> > Sell=C>50;
>> >> >> >> You got the 15 min BuyPrice but don't use it in the next 2 lines.
>> Do
>> >> >> >> you want the 5 minute C to be > BuyPrice + 1.45?
>> >> >> >>
>> >> >> >> A buy of C>1.45 does not make sense compared to a sell of C>50.
>> You
>> >> >> >> will have a buy on all bars C>1.45 and then a sell on all bars
>> with
>> >> >> >> C>50. A cross function makes more sense but since I can't see the
>> >> >> >> rest of your code all this may be fine.
>> >> >> >>
>> >> >> >> Barry
>> >> >> >>
>> >> >> >> --- In [email protected] <amibroker%40yahoogroups.com>,
>> "Louis Préfontaine"
>> >> >> >> <[EMAIL PROTECTED]> wrote:
>> >> >> >> >
>> >> >> >> > Hi,
>> >> >> >> >
>> >> >> >> > I tried this as a test but it doesn't work well:
>> >> >> >> >
>> >> >> >> > //SetTradeDelays( 1, 1, 1, 1 );
>> >> >> >> >
>> >> >> >> > TimeFrameSet (in5Minute);
>> >> >> >> >
>> >> >> >> > C5=Ref (C,1);
>> >> >> >> >
>> >> >> >> > TimeFrameRestore();
>> >> >> >> >
>> >> >> >> > BuyPrice = TimeFrameExpand (C5,in5Minute);
>> >> >> >> > Buy = C>1.45;
>> >> >> >> > Sell=C>50;
>> >> >> >> >
>> >> >> >> > All my signals are based on 15-minute bars but I do have
>> 5-minute
>> >> >> >> bars in
>> >> >> >> > the database. What I am trying to do is simply set the buyprice
>> >> >> >> not as the
>> >> >> >> > close of the 15-minute bar, but as the close of the next
>> 5-minute
>> >> >> >> bar...
>> >> >> >> >
>> >> >> >> > Louis
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > 2008/6/20 Louis Préfontaine <[EMAIL PROTECTED]>:
>> >> >> >> >
>> >> >> >> > > Hi,
>> >> >> >> > >
>> >> >> >> > > I mean, if I work with 15-minute bars, wouldn't it be simply
>> >> >> >> > > more
>> >> >> >> > > complicated to use 5-minute bars and then timeframeexpand
>> every
>> >> >> >> single rule
>> >> >> >> > > but this particular buyprice?
>> >> >> >> > >
>> >> >> >> > > Thanks,
>> >> >> >> > >
>> >> >> >> > > Louis
>> >> >> >> > >
>> >> >> >> > > 2008/6/20 Louis Préfontaine <[EMAIL PROTECTED]>:
>> >> >> >> > >
>> >> >> >> > >> Hi,
>> >> >> >> > >>
>> >> >> >> > >> Is it possible to do the opposite? Or, if I use 15-minute
>> bars
>> >> >> >> (but my
>> >> >> >> > >> database is in 5-minute bars) to set the buyprice at the
>> Close
>> >> >> >> of the first
>> >> >> >> > >> of the three 5-minute bars?
>> >> >> >> > >>
>> >> >> >> > >> Thanks,
>> >> >> >> > >>
>> >> >> >> > >> Louis
>> >> >> >> > >>
>> >> >> >> > >> 2008/6/20 Graham <[EMAIL PROTECTED]>:
>> >> >> >> > >>
>> >> >> >> > >> You have to set your base time period to 15 minute and use 1
>> >> >> >> hour
>> >> >> >> > >>> timeframe over it
>> >> >> >> > >>>
>> >> >> >> > >>> --
>> >> >> >> > >>> Cheers
>> >> >> >> > >>> Graham Kav
>> >> >> >> > >>> AFL Writing Service
>> >> >> >> > >>> http://www.aflwriting.com
>> >> >> >> > >>>
>> >> >> >> > >>> 2008/6/20 Louis Préfontaine <[EMAIL PROTECTED]<rockprog80%
>> >> >> >> 40gmail.com>
>> >> >> >> > >>> >:
>> >> >> >> > >>>
>> >> >> >> > >>> > Hi,
>> >> >> >> > >>> >
>> >> >> >> > >>> > If this is not possible, I'd like to be able to set a %
>> >> >> >> adjustment that
>> >> >> >> > >>> > depend on the price and liquidity of the stock. I used to
>> >> >> >> > >>> > set
>> >> >> >> a 1%
>> >> >> >> > >>> > adjustment, but 1% of 50$ is 0.5, and no way there would
>> be
>> >> >> >> 0.5
>> >> >> >> > >>> difference
>> >> >> >> > >>> > between signal and when I buy. On the other side, 1% of
>> 1$
>> >> >> >> > >>> > is
>> >> >> >> 0.1, so
>> >> >> >> > >>> it
>> >> >> >> > >>> > may not be enough... Anybody thought about this?
>> >> >> >> > >>> >
>> >> >> >> > >>> > Louis
>> >> >> >> > >>> >
>> >> >> >> > >>> > 2008/6/19 Louis Préfontaine <[EMAIL PROTECTED]<rockprog80%
>> >> >> >> 40gmail.com>
>> >> >> >> > >>> >:
>> >> >> >> > >>> >>
>> >> >> >> > >>> >> Hi,
>> >> >> >> > >>> >>
>> >> >> >> > >>> >> I am using 1-hour bars and wouldn't like to set my
>> buyprice
>> >> >> >> or
>> >> >> >> > >>> sellprice
>> >> >> >> > >>> >> at the Close of the first 15-minute bars after the
>> signal.
>> >> >> >> > >>> >> I
>> >> >> >> toyed
>> >> >> >> > >>> with
>> >> >> >> > >>> >> timeframe but still not sure how to do this.
>> >> >> >> > >>> >>
>> >> >> >> > >>> >> If anyone know how to do this; this shouldn't be
>> >> >> >> > >>> >> complicated.
>> >> >> >> > >>> >>
>> >> >> >> > >>> >> Thanks again!
>> >> >> >> > >>> >>
>> >> >> >> > >>> >> Louis
>>  
>>
>
>

Reply via email to