ChartPane properties
Author: superticker
Creation Date: 9/10/2017 2:10 PM
profile picture

superticker

#1
I'm not able to get most of the ChartPane properties to work right in WLP 6.9.18.0:

CODE:
Please log in to see this code.
Returns zero. Am I calling this wrong?

CODE:
Please log in to see this code.
Simply negates the parameter. What's with that?

CODE:
Please log in to see this code.
Returns the Max and Min for a Double type. I don't need a chart property for that.

It's the last pair of properties I'm most concerned about. I'm trying to vertically place a ...
CODE:
Please log in to see this code.
call, but my attemps aren't working without the .MaxValue and .MinValue properties. How do I make those properties work?
profile picture

Eugene

#2
As mentioned in the QuickRef, the ConvertValueToY, Top, Height properties of ChartPane have no use in Strategies. They are designed for development of ChartStyles.

MaxValue, MinValue are not documented in the QuickRef and consequently, not supported.

QUOTE:
but my attemps aren't working

What is not working exactly (this code is working for me)?
profile picture

superticker

#3
QUOTE:
... mentioned in the QuickRef, the ConvertValueToY, Top, Height properties of ChartPane have no use in Strategies. They are designed for development of ChartStyles.
I didn't realize that meant these properties are "out of scope" for strategies. I never got an out-of-context compilation error when compiling them in a strategy.

QUOTE:
What is not working exactly?
The above code works about 90% of the time. However, about 10% of the time the prices in the PricePane drop so low that it forces this 11-pt, Annotated-Chart, corner message off the chart window so it's not entirely visible. What I would like to do in those cases is move the corner message to the top of the pane when the prices are so low that placing the message below these low bars would force it off the window. My "ideal" solution would look something like this:

CODE:
Please log in to see this code.
Is there a tricky way to approximate something similar to this?
profile picture

Cone

#4
CODE:
Please log in to see this code.
profile picture

superticker

#5
Wow, it gets more complicated without the ChartPane .MinValue and .MaxValue properties. It would be nice to get those properties working, but operational bug fixes (like displaying positions for "All Accounts" in the Account Balances and Positions window) should have priority.

Combining your and my solutions, this is the hybrid solution I'm currently using.

CODE:
Please log in to see this code.
I welcome comments. And thanks for all the help.
profile picture

superticker

#6
I'm having a scoping problem with the ChartStyle object inside a DLL library routine (where my above code resides). If I examine a single symbol with my strategy, the WealthScriptInstance.ChartStyle returns a valid object and everything works as expected. But if I'm running my strategy on multiple symbols, the WealthScriptInstance.ChartStyle returns "null" in my DLL. Why does this difference exist?

From a scoping prospective, in what areas of the strategy code is ChartStyle defined when multiple symbols are "in play"? I mistakenly thought ChartStyle would be visible throughout the entire Execute() procedure when working with multiple symbols. If the ChartStyle object is only available in the WealthScriptInstance part of the time when multiple symbols are in play, at what points would it be available?

I do think when the Execute() routine brings in a new symbol (multiple symbols in play), it should null out the previous ChartStyle object. I like that behavior; don't change that.
profile picture

Eugene

#7
QUOTE:
But if I'm running my strategy on multiple symbols, the WealthScriptInstance.ChartStyle returns "null" in my DLL. Why does this difference exist?

Answered in the QuickRef > ChartStyle Property. This is by design.
profile picture

superticker

#8
I see your point. One doesn't need to be doing AnnotateChart() operations in the first place--to avoid overhead--if there's no observable single chart. I should be exiting my corner-messaging library routine when ChartStyle is null. Thanks for pointing that out. :)

I corrected the code above so it exits when ChartStyle is null.
profile picture

Eugene

#9
Your understanding is correct.