Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/13/2005(UTC) Posts: 715 Location: Midwest, USA
Was thanked: 1 time(s) in 1 post(s)
|
Given two charts, if you drag one security to the other chart, is there any way to attach an expert to the 2nd security?
I mainly want to use the "Highlight" feature on the 2nd security.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
In short... No you cannot attach the expert advisor to the second security.
Expert Advisors are attached to the underlying or foundation security. You could use some code to add to exisiting Expert Advisor or create another indicator to achieve an alternative result.
wabbit [:D]
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/13/2005(UTC) Posts: 715 Location: Midwest, USA
Was thanked: 1 time(s) in 1 post(s)
|
I mainly want to color the line, according to certain critera. Do you think this can be done?
I'm open to any suggestions...
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
If you are only showing the second security as a line, you can write an indicator along the lines of : Code:
ind:=Security("my other security",C);
highlight1:=(ind>criteria)*ind;
highlight2:=(ind<=criteria)*ind;
This will mess the scaling somewhat if the security price is quite large (absolutely) compared to zero, so you might want to add some scaling factor to keep the indicator within a suitable range. wabbit [:D]
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/13/2005(UTC) Posts: 715 Location: Midwest, USA
Was thanked: 1 time(s) in 1 post(s)
|
When I try that, the line drops vertically to zero. Is there an equivalent function to Excel's "NA()", which would stop anything from being plotted?
The problem seems to be when the indicator causes either value to be zero (so the other will plot).
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
JJ, You can avoid overscaling by using o third indicator, coloured the same as the background, to obscure the variant points in the first two plots. If you plot all these as points as recommended, then you can have a more useful result with minimum fuss. e.g. Code:
{using some 'tricks' to prevent overscaling of the plot}
ind:=Security("TLS",C);
h1:=If(ind>=Mov(ind,20,S),ind,ind-.2);
h2:=If(ind<=Mov(ind,20,S),ind,ind-.2);
h3:=ind-.2;
{plot us points of weight 2 with whatever colours}
h1;h2;
{plot me as points with heaviest weight and colour the same as the chart background}
h3;
wabbit [:D]
|
|
|
|
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.