SetContext only showing trades on primary stock
Author: jheffez
Creation Date: 12/1/2016 10:35 AM
profile picture

jheffez

#1
I would like to see the trading signal (triangle graphical entry/exit) on the chart, on the alternate (setcontext) ticker. Meaning, let's say my main ticker is SPY and I would like to execute the trading on IWM. In addition to SPY I plot IWM via:
CODE:
Please log in to see this code.


Then, when I get the buy signal I do something like:
CODE:
Please log in to see this code.

I can see in the Trades tab that the trade was executed but I see no indication on the Chart. Is there any way to show the buy trade on the chart on the alternate symbol (IWM in this case)?

Thanks.
profile picture

Eugene

#2
Sure there is, if you visit this FAQ > Is there a way to see the trades on secondary symbols?
profile picture

jheffez

#3
I just tried the code in the link. The green annotation show on the main, not secondary ticker. Code below:

Before the buy signal:
CODE:
Please log in to see this code.


At buy:
CODE:
Please log in to see this code.


What am I doing wrong?
profile picture

Harapa

#4
This wroks for me:
"sPane5i" is pane to plot secondary symbol.
"inverse" call for second symbol
This will draw a circle of indicated color ( which may be hard to see first but it is there). [s]Ideally, I like to see the marking to appear above/below the price;how of which I have yet to figure out. Still work in progress.[/s] Fixed.


CODE:
Please log in to see this code.


and
CODE:
Please log in to see this code.


You can use arrow function by specifying the "pane".
CODE:
Please log in to see this code.
profile picture

Eugene

#5
Harapa, thanks for the heads-up. AnnotateChart can be used as per the ActiveTrader... strategy example I pointed at earlier. Updated the Wiki FAQ.