I would like to create an Oscillator that plots in a subgraph but puts text and arrows on the price panel when the oscillator conditions meet a certain state. I would also like to put text and arrows on the Oscillator in the subgraph. Can I reuse the setPriceStudy() function throughout the code or only in the PreMain? Is there some other way to accomplish this?
Announcement
Collapse
No announcement yet.
Plot on Subgraph and Draw Objects on Price Panel
Collapse
X
-
Can I reuse the setPriceStudy() function throughout the code or only in the PreMain?
create an Oscillator that plots in a subgraph but puts text and arrows on the price panel when the oscillator conditions meet a certain state
Method 1:
1. In the subgraph have the study that plots the oscillator with arrows/text in the subgraph and also sets global values (true/false or 0/1, etc) via setGlobalValue() to trigger the arrows/text plotting in the price graph.
2- In the price graph have a study that reads the global values from the subgraph oscillator study via getGlobalValue() and uses it as a trigger to draw the arrows/text on the price graph.
Method 2:
Have two similar studies with the following differences:
Difference Sub Graph Price Graph
Oscillator Plot yes no
setPriceStudy() value false true
arrow/text offsets based on oscillator based on price chart
Both these methods should yield what you are asking for.
WayneLast edited by waynecd; 07-11-2013, 12:04 AM.
-
Method 2 was supposed to be in table format.
The following may be clearer:
Method 2:
Have two similar studies with the following differences:
Sub Graph Study:
Plots the oscillator
Set the setPriceStudy() value to false
Arrow/text offsets are based on oscillatorPrice Graph
Price Graph Study:
Does not plot the oscillator
Set the setPriceStudy() value to true
Arrow/text offsets are based on price chart
Wayne
Comment
Comment