Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider adding Vector Candle support #304

Closed
OutOfThisPlanet opened this issue Apr 16, 2023 · 17 comments
Closed

Please consider adding Vector Candle support #304

OutOfThisPlanet opened this issue Apr 16, 2023 · 17 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@OutOfThisPlanet
Copy link

OutOfThisPlanet commented Apr 16, 2023

I'm not sure if it would be easy to implement, however, I would love to see "Vector Candles" supported in the interface.

Examples in this tradingview screenshot, using the indicator called TR_MAIN (Trader's Reality):
There are also volume vectors in this screenshot, using the indicator PVSRA_VS.

image

In the above image, the Vector Candles are the Green, Blue, Red, and Violet candles, and are used to show market-maker manipulation.

I became aware of this indicator via the youtube channel Traders Reality, and my trading has improved tenfold since using that strategy.

For more information, check this video :)

https://www.youtube.com/watch?v=Kwhnj80Qvn8

@OutOfThisPlanet OutOfThisPlanet added the enhancement New feature or request label Apr 16, 2023
@OutOfThisPlanet OutOfThisPlanet changed the title Add Vector Candle Support Please consider adding Vector Candle support Apr 16, 2023
@lmvdz
Copy link
Contributor

lmvdz commented Apr 27, 2023

$price.color = barColour to set the bar color in aggr script

@hashemh4a
Copy link

is the for aggr ? if yes how to add to aggr thx mate :)

@lmvdz
Copy link
Contributor

lmvdz commented May 1, 2023

Script it correct, but the colors aren't printing the same as the TV script

image

@lmvdz
Copy link
Contributor

lmvdz commented May 1, 2023

Fixed it, was (vbuy+vsell) not (vbuy-vsell).

high = $price.high
low = $price.low
close = $price.close
open = $price.open
volume = (vbuy+vsell)

averageVolume = sum(volume[1], 10)/10.0
volumeSpread = volume*(high - low)
highestVolumeSpread = highest(volumeSpread[1], 10)
color = 
  (
    (volume >= 2*averageVolume || volumeSpread >= highestVolumeSpread) ? 
      (close > open ? options.greenVectorColor : options.redVectorColor) : 
    (volume >= 1.5*averageVolume) ? 
      (close > open ? options.blueVectorColor : options.violetVectorColor) : 
    (close > open ? options.regularCandleUpColor : options.regularCandleDownColor)
  )

histogram({
  time: time,
  value: volume < 0 ? Math.abs(volume) : volume,
  color: color
})

$price.color = color

@lmvdz
Copy link
Contributor

lmvdz commented May 2, 2023

@Tucsky when I modify the $price.color via indicator, the current candle doesn't use the correct color

@lmvdz
Copy link
Contributor

lmvdz commented May 2, 2023

image

@lmvdz
Copy link
Contributor

lmvdz commented May 2, 2023

image

Latest candles don't get updated with the color from the indicator

@lmvdz
Copy link
Contributor

lmvdz commented May 2, 2023

image
Only way I've found is to open the Indicator and save it, causes the candle colors to repopulate

@lmvdz
Copy link
Contributor

lmvdz commented May 3, 2023

indicator_pvsra.txt

Already has the colors setup for you.

@adeacetis
Copy link
Collaborator

Hi @lmvdz,

I have tried to import your indicator to aggr.trade and I get this error:
image

Is that normal ?

@OutOfThisPlanet
Copy link
Author

How do you set this up... do you have to self-host?

@lmvdz
Copy link
Contributor

lmvdz commented May 4, 2023

Click the Add button by indicators
Click Import in bottom left
Select the indicator_pvsra.txt you downloaded.
Make sure your Price indicator has the name price
Open the PVSRA indicator you added, and press Save. This will update the color of the bars to reflect the volume.

image

@lmvdz
Copy link
Contributor

lmvdz commented May 4, 2023

Will need to wait for word from @Tucsky about how to get the price bar colors to update automatically.

@OutOfThisPlanet
Copy link
Author

This is truly awesome work, @lmvdz

Thanks so much!

@adeacetis adeacetis added bug Something isn't working help wanted Extra attention is needed and removed enhancement New feature or request labels May 5, 2023
@adeacetis
Copy link
Collaborator

adeacetis commented May 5, 2023

Hello all,

It seems an unidentified issue prevents the chart to update bar charts colors unless you edit and save the indicator which forces repainting candles.

You might have to file a separate bug report. Let's see what @Tucsky think about that.

Tucsky added a commit that referenced this issue May 12, 2023
@Tucsky
Copy link
Owner

Tucsky commented May 12, 2023

@lmvdz

This is whats happening and why the candle color isn't the one from the PVSRA indi for realtime bars :

Every refreshRate (which can go as many as your monitor's hz) it does the following

  • loop through every indicators
     - run the indicator script (which renders the corresponding series points)

For example with price and PVSRA indi on

  1. price indicator get processed, price serie get rendered
  2. PVSRA get processed (it assigns color to price, which was already rendered), PVSRA serie(s) get rendered

To fix that issue we have to separate the script processing & rendering

  • loop through every indicators
     - run the indicator script
  • loop through every indicators again
     - loops through indicator's series
      - render the point (if needed, aka not empty point, null or unchanged)

More loops needed and unfortunately more memory footprint, idk how I feel about that yet but it's live on https://tucsky.github.io/aggr

@OutOfThisPlanet
Copy link
Author

This is awesome :)

So many thanks, folks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants