- ago
Is there anyway a feature like this can be added to visualize trades on a chart better? I like these filled in squares showing where trades take place and I find this much easier to see. This is taken from Trade Navigator which I used prior to Wealth-lab.

Thanks!






0
165
5 Replies

Reply

Bookmark

Sort
Cone8
 ( 25.51% )
- ago
#1
I know everyone wants their favorite customization to be in WealthLab, but it's a pretty simple thing to do it yourself in a script (or add a single call to a custom library that does it).

And here you go - just add this routine to a C# Coded script, put it right above the Execute method, for example.
CODE:
public override void Cleanup(BarHistory bars) {          foreach (Position p in GetPositions())          {             int xbar = p.IsOpen ? bars.Count - 1 : p.ExitBar;             double xprice = p.IsOpen ? bars.Close.LastValue : p.ExitPrice;             FillRectangle(p.EntryBar, p.EntryPrice, xbar, xprice, p.Profit > 0 ? WLColor.LawnGreen : WLColor.LightSalmon, "Price", true);                      } }
1
- ago
#2
I'm a no coder...sorry.
0
Cone8
 ( 25.51% )
- ago
#3
No need to be a coder. But if you want to see this right now

1. make your block strategy,
2. hit "Open as C# Coded Strategy
3. Paste that block of code in the Editor as indicated here -


Run Strategy. (Adjust the colors in the block to your liking.)
0
Glitch8
 ( 11.39% )
- ago
#4
We could also craft a custom block to do this, as a Concierge job?
0
- ago
#5
You might want to add some transparency to those colored boxes. I'm not sure how much is appropriate.

CODE:
FillRectangle(p.EntryBar, p.EntryPrice, xbar, xprice, p.Profit > 0 ? WLColor.LawnGreen.SetAlpha(128) : WLColor.LightSalmon.SetAlpha(128), "Price", true);
For aesthetic customizations, C# code is easier and better. You can tweak the look.
0

Reply

Bookmark

Sort