Problems with StaticPosition

Created at 15 Nov 2012, 21:23
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!
MA

magico

Joined 25.10.2012

Problems with StaticPosition
15 Nov 2012, 21:23


Hello admin,

I've problems with the position of ChartObjects.DrawText.

With this code, i haven't got problems,

    string Code = "    " + Convert.ToString(Symbol.Code);
    string Ask = "\n    "+ Convert.ToString(Symbol.Ask);
    string Bid = "\n\n    "+ Convert.ToString(Symbol.Bid);
    string Spread = "\n\n\n    "+ Convert.ToString(Convert.ToSingle (Symbol.Spread)*10000);    
    string Digits = "\n\n\n\n    "+ Convert.ToString(Symbol.Digits);    
    string PipSize = "\n\n\n\n\n    "+ Convert.ToString(Symbol.PipSize);
    
    ChartObjects.DrawText("Labels", 
    "Code:" + "\n"
    + "Ask:" + "\n"
    + "Bid:" + "\n"
    + "Spread:" + "\n"
    + "Digits:" + "\n"
    + "PipSize:" + "\n"    
    , StaticPosition.TopLeft, Colors.Yellow);

    ChartObjects.DrawText("Code", Code, StaticPosition.TopLeft, Colors.LightBlue);
    ChartObjects.DrawText("Ask", Ask, StaticPosition.TopLeft, Colors.LightBlue);    
    ChartObjects.DrawText("Bid", Bid, StaticPosition.TopLeft, Colors.LightBlue);
    ChartObjects.DrawText("Spread", Spread, StaticPosition.TopLeft, Colors.LightBlue);    
    ChartObjects.DrawText("Digits", Digits, StaticPosition.TopLeft, Colors.LightBlue);
    ChartObjects.DrawText("PipSize", PipSize, StaticPosition.TopLeft, Colors.LightBlue);

 

But if i change the static position, the draw is wrong (p.e. StaticPosition.TopRigth, or BottomLeft...

 

Thanks

 


@magico
Replies

admin
20 Nov 2012, 17:31

We are looking into it, for the time being please use a different static position.

 


@admin

magico
21 Nov 2012, 10:28

RE:
admin said:

We are looking into it, for the time being please use a different static position.

 


Thanks for you interest.

@magico

ArthurV
14 Jan 2013, 17:14

RE:
admin said:

We are looking into it, for the time being please use a different static position.

 

 

Hello Admin,

 

Instead of showing spread 0.1, it shows 0.999999. Could you fix it please?

Also it does not represent the spread accurately as it is on a Market Analysis layout... It delays significantly I suppose...

Basically, I am interested in spread only, so possibly you can reference to any other indicator?

I didn't find anything similar among the indicator list

 

Kind Regards,

Arthur


@ArthurV

admin
14 Jan 2013, 18:11

Hello Arthur,

You can use Math.Round( Spread, 1) to round to one decimal digit. 

string Spread = Convert.ToString(Math.Round(Symbol.Spread*10000, 1));    

We will look into the delay issue.

I'm not sure what you mean by this statement though "reference to any other indicator". Could you please be more specific as to what it is you are trying to do?

Regards.


@admin