View Single Post
  #5 (permalink)  
Old 02-26-2008, 09:56 PM
hiachiever hiachiever is offline
Member
 
Join Date: Jan 2006
Posts: 56
hiachiever is on a distinguished road
Quote:
Originally Posted by Dave137 View Post
I know how to create several versions of ObjectCreate.

Here is the problem I am having: I want to create a big 'Up' arrow on the right side of the graph. The Wingding to be used is #233 (up arrow).

I want a logic statement that if a>0 then a big 'UP' Lime color arrow will display on the graph using ObjectCreate.

I do not know how to create the statement - if(a>0){ ???? } and then how to praise the Wingding (233) in the ObjectCreate statement so it will display properly, size 24??

Can somebody please help me with my problem!

Dave

I am a bit stumped at this point!
Hi Dave,

Here is some code that I have extraxted from one of my indicators. I must first add that I took a whole chunk of code out, and then edited in a text editor, so this code is purely for example purposes only to give you an idea of how to code what you are looking to do.

Here is the code snippet.
{
//WingDing Codes
string Arrow12 = "é"; // Thick Arrow 12 o'clock
string Arrow6 = "ê"; // Thick Arrow 6 o'clock

int Corner_of_Chart_RIGHT_TOP = 0;
string arrow;
color LblColor;

//Set defaults
LblColor = Red;
Arrow= Arrow6;

if (A> 0) {LblColor = Lime; Arrow= Arrow12;}

CreateLabel("Price",Arrow, 30, "WingDings", LblColor, Corner_of_Chart_RIGHT_TOP,20,20);
}

void CreateLabel(string LblName, string LblTxt, double FontSz, string FontName, color FontColor, int Corner, int xPos, int yPos)
{
if(ObjectFind(LblName) != 0) ObjectCreate(LblName, OBJ_LABEL, 0, 0, 0);

ObjectSetText(LblName, LblTxt, FontSz, FontName, FontColor);
ObjectSet(LblName, OBJPROP_CORNER, Corner);
ObjectSet(l LblName Name, OBJPROP_XDISTANCE, xPos);
ObjectSet(LblName, OBJPROP_YDISTANCE, yPos);
}

If you get stuck feel free to PM me.

Cheers,
Hiachiever
Reply With Quote