Display price near candle

Created at 30 Sep 2015, 12:04
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
KA

karlson

Joined 22.02.2013

Display price near candle
30 Sep 2015, 12:04


Hi,

How to display price near candle on cTrader without using bid/ask lines ? Please, thank you.


@karlson
Replies

LSR2412
30 Sep 2015, 16:14

RE:
using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class Priceatcandle : Indicator
    {
        //private int _outsideperiods;
        public override void Calculate(int index)
        {

            {

                if (IsRealTime)

                    ChartObjects.DrawText(index.ToString(), MarketSeries.Close[index].ToString(), index, MarketSeries.Low[index] - Symbol.PipSize * 6, VerticalAlignment.Bottom, HorizontalAlignment.Center, Colors.Gray);


            }
        }
    }
}

showing last price just below last candle

 

karlson said:

Hi,

How to display price near candle on cTrader without using bid/ask lines ? Please, thank you.

 


@LSR2412

LSR2412
30 Sep 2015, 17:33

using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class Priceatcandle : Indicator
    {

        public override void Calculate(int index)
        {

            {

                ChartObjects.DrawText("price", MarketSeries.Close[index].ToString(), StaticPosition.Right, Colors.Red);

            }
        }
    }
}

please ignore my first code..this is ok


@LSR2412

karlson
30 Sep 2015, 21:46

Thank you very much for your help. Is it possible to have last price moving along the last candle ? Or displaying an arrow along last candle?


@karlson

LSR2412
01 Oct 2015, 08:47

RE:
using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class Priceatcandle : Indicator
    {

        public override void Calculate(int index)
        {

            {

                ChartObjects.DrawText(index.ToString(), MarketSeries.Close[index].ToString(), index + 1, MarketSeries.Close[index], VerticalAlignment.Center, HorizontalAlignment.Right, Colors.Gray);
                ChartObjects.RemoveObject((index - 1).ToString());
            }
        }
    }
}

karlson said:

Thank you very much for your help. Is it possible to have last price moving along the last candle ? Or displaying an arrow along last candle?

this is with "Last" price moving


@LSR2412

LSR2412
01 Oct 2015, 08:51

RE:
using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class Priceatcandle : Indicator
    {

        public override void Calculate(int index)
        {

            {

                ChartObjects.DrawText(index.ToString(), "←", index + 1, MarketSeries.Close[index], VerticalAlignment.Center, HorizontalAlignment.Right, Colors.Gray);
                ChartObjects.RemoveObject((index - 1).ToString());
            }
        }
    }
}

karlson said:

Thank you very much for your help. Is it possible to have last price moving along the last candle ? Or displaying an arrow along last candle?

this is with arrow....put any symbol instead of this arrow in quotation marks and it will be displayed


@LSR2412

karlson
01 Oct 2015, 14:57

Excellent! Many thanks!!!


@karlson