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

Re: [amibroker] Help with valuewhen and trough:



PureBytes Links

Trading Reference Links

Graham 

Thanks for taking the time to reply.


> what you have is the value of trough at the time Buy
> is signalled, ie
> trough prior to Buy

Yup that is what I am after: I want to plot the value
of this second previous low at the time of the buy
signal.

I thought that the 2 in ...

 trough(ARRAY, change, n = 2)

meant I get the last but one (second last trough
value), but can play with this later.

What I want to do is plot this as a fixed value which
does *not* change as the price changes.

I have plotted this as an attempt:

b = Cross(C,EMA(C,30));
Y = ValueWhen(B,Trough(L,1,2),1);

Plot(Close,"close",colorBlack,64);
Plot(EMA(C,30),"ema 30",colorBlue,1);
Plot(Zig(L,1),"zig",colorGold,1);
Plot(y,"VALUEWHEN BUY",colorOrange, 1 | styleThick);

> Do you get additional buy signals after the initial
> one, if so these
> will reset your sell condition

No, there are no additional buy signals.
The Y value as indicated above seems to move up and
down with subsequent price action.

How do I stop the Y value from moving up or down?

What function can I use to take the value from Y and
plot it as a fixed straight line as in

Plot(1.5, "value",colorred,1); ???

independent of subsequent price action?

I am not sure if I am explaining this well.
Perhaps I should draw this and post the graphic?

Regards

ChrisB
 
> > Hi All...
> > 
> > I want to set my initial hard stop at the second
> last
> > pivot point low using the Trough function.
> > 
> > This is what I have tried:
> > 
> > buy = whatever;
> > 
> > initialStop = valuewhen(buy,trough(L,0.5,2),1);
> > 
> > sell = cross(initialStop,close);
> > 
> > when I test this on an individual stock to check
> the
> > exits I find this is not as expected.
> > I get sell arrows when the close has NOT crossed
> the
> > value of initial stop.
> > 
> > I want the value of the second last trough at
> entry to
> > stay FIXED.
> > 
> > Where am I going wrong?
> > 
> > How can I code this?
> > 
> > Regards
> > 
> > ChrisB
> > 
> > __________________________________
> > Do you Yahoo!?
> > The all-new My Yahoo! - What will yours do?
> > http://my.yahoo.com
> > 
> > 
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> > 
> > Check group FAQ at:
>
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> 
> 
> -- 
> Cheers
> Graham
> http://e-wire.net.au/~eb_kavan/
> 



	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail


------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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/