Multi-colored moving average

Discussion in 'App Development' started by gaihosa, Apr 11, 2016.

  1. gaihosa

    gaihosa

    I am trying to create a line that when it is ascending along the Y axis it is green, descending red and sideways blue QCustomPot. This image shows what I am looking to do.

    [​IMG]
    I have played around with different classes of QCP but none seam to be able to change the pen color while using addDate(). setData() doesn't allow for a third variable for example a colormap to be added.I tried using QCPPainter but with no scucess. Any suggestions on where to start?
     
    Last edited: Apr 11, 2016
  2. I think the colour is not a big issue here...it's the moving average levels...that's does not seem right...with these moving average level crossover, you'll likely to get more false signals.

    The psychology bias is when you're in the losing side, you don't close your positions...
     
    murray t turtle likes this.
  3. gaihosa

    gaihosa

    I am not looking to do a cross over. The image I got from somewhere else. I just want to know how to have the line change color based on its direction sush as illustrated in the image using Qcustomplot.
     
  4. %%
    Exactly; especially since red + green candles help more than red + green moving averages.200 day ma helps==========================================