|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Basic Indicator Question
I have an indicator that I want to print text objects on the chart, however, I want them to be on the right upper corner of the charts instead of the left upper corner. How do I code this in the indicator?
|
|
|||
|
Quote:
|
|
|||
|
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! |
|
|||
|
Quote:
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 |
|
||||
|
Arrow code
Quote:
string MA_Signal=""; color ma_color; double price = NormalizeDouble(MarketInfo(Symbol(),9),Digits); double MA = iMA(Symbol(),0,15,0,1,0,0); if(MA>price){MA_Signal="ê";ma_color =Red;} if(MA<price){MA_Signal="é";ma_color =Lime;} ObjectDelete("Arrow"); ObjectCreate("Arrow", OBJ_LABEL, 0, 0, 0); ObjectSetText("Arrow",MA_Signal, 80, "Wingdings", ma_color ); ObjectSet("Arrow", OBJPROP_CORNER, 1); ObjectSet("Arrow", OBJPROP_XDISTANCE, 20); ObjectSet("Arrow", OBJPROP_YDISTANCE, 40 ); Here is an example indicator with this code in it and another indicator fanSimple which shows the use of the numbered Arrow code ie 233 234 etc cja Arrow Wingdings.mq4 fanSimple8-1a_NEW.mq4 |
|
|||
|
Thanks! I did it and got it to work - Yahooo!
One more thing I have learned on programming this language. I have one other question I would like to post, but seeing it is getting late here in Houston, Texas, I will ask it tomorrow. I really appreciate the help - There are a great bunch of good people that are members that make up this forum - I say honestly that from my 3+ years of forex history this is probably the "Best Forex Forum" on the internet ![]() Have a Great Night or Day, wherever you live! Dave |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Basic questions ... | cardio | Questions | 58 | 06-27-2008 03:51 PM |
| MT4 (Basic) Questions | stepwise | Metatrader 4 | 2 | 05-21-2007 04:03 PM |
| Very basic coding help needed | camisa | Questions | 1 | 05-08-2006 05:36 PM |