logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Derek Worswick  
#1 Posted : Friday, November 4, 2011 3:38:44 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi Is it possible to have a single formula to plot both the sine wave formula below… variable = “W1” And the vertical lines for the peaks and troughs in the same sine wave Peaks= “pk “ Troughs = “ tr “ When I try to plot both the sine wave “W1” and “pk” and “tr” I get a miss match with the scaling The only way I can over come this miss match with the scaling Is to have two separate formulas one for sine wave variable = “W1” and second formula for the vertical lines for the peaks “pk” and troughs “tr” ----------8<------------------------------------------------ Period1:=Input("Cycle Period 1",3,1000,179); B:=LastValue(Cum(1)); Prd:=Period1; A:=Cum(1)*360/Prd; F:=2*Sum(C*Cos(A),B)/B; G:=2*Sum(C*Sin(A),B)/B; J:=LastValue(Sqrt(Power(G,2)+Power(F,2))); K:=LastValue(Atan(G,F)*57.29577951); W1:=LastValue(Mov(C,B,S))+J*Cos(A-K); pk:=If(Ref(W1,-1)=HHV(W1,3),W1,0); pk; tr:=If(Ref(W1,-1)=LLV(W1,3),W1,0); tr; ---------------8<------------------------------------------- Best regards, Derek
mstt  
#2 Posted : Friday, November 4, 2011 7:32:06 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi Derek

Part of your question seems to be the same as the previous poster, namely, how to plot two disparate plots in the same window without one distorting the other. Assuming both plots swing from zero to some positive value, what you can do is calculate a reduction factor for one based on LastValue(Highest("plot A")) relative to LastValue(Highest("Plot B")). One of the things that I do with a Trade Equity Portfolio Display is plot the portfolio equity curve along with the number of open trades after applying a reduction factor to the equity curve.

The thing is that you cannot scale one plot of an indicator to the left scale and the other to the right - only one scale can be used per indicator. So maybe you just need to shift the centre line of the sine wave or the FALSE level for the peak/trough markers. I think for these markers you'd probably want to use a histogram. However, applying a bias to the sine wave centre line might be the way to go.

Hopefully these random thoughts are of some help.

Roy

Derek Worswick  
#3 Posted : Saturday, November 5, 2011 1:13:04 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi Roy, Thank you for reply & information " The thing is that you cannot scale one plot of an indicator to the left scale and the other to the right - only one scale can be used per indicator " Best regards, Derek
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.