• Sign up >>

Trade function arrows

To add comments, please log in or register
Matt
77
Matt  
What else can be done (besides color) with the arrows made by the order function?

I like the arrow, with lines for SL and TP. But, I have a client who wants a line for buy, another for sell and another for profit. Can this be done with the order function's arrow field, or do I need to build them from scratch? If I need to build it, is it simply a matter of building an object with the apropriate paramaters?

Thanks for the help
Slava
Moderator
13395
Slava  
With order function You can control arrow colors only. You need to create your own object (horizontal line).
Matt
77
Matt  
Thanks stringo. Check my thinking here.

<<order placed>>
ObjectCreate(OrderOpenTime()+OrderOpenPrice(),OBJ_RECTANGLE,0,OrderOpenTime()-1*Point,OrderOpenPrice(),OrderOpenTime()+1,OrderOpenPrice(),,); ObjectSet(OrderOpenTime()+OrderOpenPrice(), OBJPROP_COLOR, Blue);


questions:
1. Can you use datetime + double in a string (label)? Or are conversion functions necessary? Or concatenation operators?

2. How would you add a 'bar width' or similar to an open time value? I used "-1" and "+1" above, but I'm sure that must be wrong. Half a barwidth is probably what I'm really after.

3. Are the last 2 coordinates needed if the object type only uses 2? I put ", " there now as placeholders, do they need to be "0" or left off, or would the above work?

4. If this line is placed right after an order created, would that newly created order be selected, or do I need to select it before "OrderOpenTim()" and such functions would work? (or would it be better just to have those loaded into variables during order call rather than needig to select the order?)

5. The above would make a little blue horizontal line at the Open price, correct?

6. The "0" for window will take the current window, correct? (not the first window?). If not, how is the current window selected?

7. What about the "as background" checkbox on an object's properties? I did not see that in the Object properties enumeration (controls wheter object is filled or open. While I'm asking, what controls width, dashes etc.)?

Thanks Stringo! piece of cake, right? ,-)
Slava
Moderator
13395
Slava  
1. TimeToStr(OrderOpenTime())+DoubleToStr(OrderOpenPrice(),Digits)
2. -Period() and +Period()
3. It can be 4 coordinates. It can be 6 coordinates but last 2 coordinates will be silently ignored
4. You need to select order by returned ticket number
5. little blue rectangle
6. 0 is main chart window of the current chart. There may be some subwindows (for instance MACD(12,26,9) or Momentum(14)), they are numbered from 1
7. Create big rectangle or thick trendline and try to change background flag. Just do it
To add comments, please log in or register