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

RE: [amibroker] EOD-DB Preservation when switching EOD to RT



PureBytes Links

Trading Reference Links

Thanks John 
 I think I am getting closer but some how 
the ValueWhen doesn't seem to work correctly.
 It sells at a high price on a sell day which I don't understand. 
This is my script
  //Pivot Point PT
PP= (High+Low+Close)/3;
R1=(PP * 2) - Low;
R2= PP + High - Low;
S1= (PP * 2) - High;
S2 = PP - High + Low; 
Cond1 = Low <= S1;
Cond2 = High >= R1;
Buy = Cond1;
BuyPrice = S1;
Sell = Cond2;
SellPrice = ValueWhen(Buy,R1);//This should Sell at the R1 value 
//on the Buy Day?? But it doesn't??
Equity(1);

Thanks for HELPING
Ernie

--- In amibroker@xxxxxxxxxxxxxxx, "john gibb" <jgibb1@xxxx> wrote:
> Hi Ernie,
> 
> Try something like this instead:
> 
>     Sell = Cond2;
>     SellPrice = ValueWhen(Buy,R1);
> 
> As Graham implied, the Buy, Sell, Cover, and Short variables all 
need a
> True/False condition to be satisfied in order to work. ValueWhen
(Buy,R1)
> doesn't do this; it produces a number instead.
> 
> -john
> 
> ----- Original Message ----- 
> From: "Ernie Newman" <ewn87544@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Tuesday, February 24, 2004 7:48 AM
> Subject: [amibroker] Re: Help with Buy Sell Signal
> 
> 
> Thanks for the Help. I think I've got it figured out except I want
> to use the R1(resistance) level that was established on the Buy day
> as a sell point it could be 2 or 3 days later and the R1 value
> changes each day. I have been trying to use the valuewhen function
> but can't seem it get it working.
> 
> Sell = ValueWhen(Buy,R1) AND Cond2;
> How can I get this to return the R1 value for the day the buy signal
> occured.
> Thanks alot!!
> Ernie
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> > A couple of things
> > The Buy = should have a 0 or 1 answer (true or false) Buy =
> BuyPrice does
> > not work as a singular event.
> > Buy price is dictated by the buy signal and and the bar referenced
> by your
> > settradedelays.
> >
> > As far as the rest, not sure off hand except include some added 
IIF
> > conditions for the price to be >low and <high of the purchase day.
> >
> > Cheers,
> > Graham
> > http://e-wire.net.au/~eb_kavan/
> >
> > -----Original Message-----
> > From: Ernie Newman [mailto:ewn87544@x...]
> > Sent: Tuesday, 24 February 2004 10:30 AM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Help with Buy Sell Signal
> >
> >
> > Hi
> >  I am trying to test a Profit Test using support and resistance. I
> want to
> > buy only if the price hits the S1 level and buy at that
> > price and sell only when the price reaches the R1 level.
> > Where
> > PP= (High+Low+Close)/3;
> > R1=(PP * 2) - Low;
> > S1= (PP * 2) - High;
> > The below buys and sells the correct price only if the price
> reaches  that
> > level otherwise it could buy the open or sell the close. How can I
> make it
> > not buy if the price is not reached or sell.
> >
> > BuyPrice = S1;
> > Buy = BuyPrice;
> > SellPrice = R1;
> > Sell = SellPrice;
> >
> > Thanks
> >  Ernie
> >
> >
> >
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > --------------------------------------------
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > Yahoo! Groups Links
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

<*> 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/