- ago
I am under the impression that DrawHeaderText
- Writes to the upper left hand of price pane for init'
- And right below it for Exec
More than a single write in each section writes over the allocated area.
Is this a correct impression?
Thanks!
0
280
Solved
5 Replies

Reply

Bookmark

Sort
- ago
#1
I wouldn't mess with the Chart display during the Execute{block} under any circumstance. The Execute{block} is called (#of bars)*(#of symbols) times in the dataset. Why do you need to Plot or Draw that many times? You're going to slow WL down to a crawl. I would make all your Plot and Draw calls in the Initialize{block} if possible.

There might be situations where you need to Plot or Draw post-trading in Cleanup or BacktestComplete, but those would be the only exceptions.
0
- ago
#2
Thank you for the point you made. Using DrawHeaderText in Exec during bringup. One Hello message during init to identify the name of the code file. And one bool value during exec calls. Comes in handy in streaming mode. Readily visible. WriteDebugLog output is not available in streaming mode. I disabled all from WL6 code. I ceated a WriteToDebugFile for such cases. I could use this here as well.

While I am making the move from DrawHeaderText to WriteToDebugFile can you please state how DrawHeaderText works.
a) Top left for init (writes over)
b) Right below for Exec (also writes over)

Thanks!
0
- ago
#3
QUOTE:
And one bool value during exec calls. Comes in handy in streaming mode.

So something like this:
CODE:
   public override void Execute(BarHistory bars, int idx)    {       if (ExecutionMode==StrategyExecutionMode.StreamingChart)          DrawBorderText(...);
I'm not sure if the Draw operations will update during the streaming Chart. You can experiment.

You might also consider a "custom" Data Panel. But again, I'm not sure when a Data Panel actually updates. You'll need to research that. You'll need to build your Data Panel with Visual Studio. https://www.wealth-lab.com/Support/ExtensionApi/DataPanelScoreCard
0
Cone8
 ( 2.02% )
- ago
#4
QUOTE:
More than a single write in each section writes over the allocated area.
Is this a correct impression?
No. Like in the Debug Log, multiple DrawHeaderText calls write on a new line.

Maybe what you're looking for is to write to the Log Viewer. It's not cleared between runs, but you can clear it manually, if required.
CODE:
WLHost.Instance.AddLogItem(StrategyName, "string to write", WLColor.Blue);
0
Best Answer
- ago
#5
Since the Alert is a Boolean indicator, perhaps he would be better off playing several different "alert" sounds. https://www.wealth-lab.com/Discussion/Play-sounds-in-C-code-10524
0

Reply

Bookmark

Sort