Arrow Style seem not OK

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Arrow Style seem not OK

Postby arjfca » 18 Jul 2013

Hello

I want to display slim arrow's on my chart. Every value set on ARW_SetStyle return the same appearance.

Martin

Code: Select all

Value1 = arw_new_s(Date,Time_s, High+.0004,Arrowdown);
Value1 = arw_setcolor(value1, Blue);
Value1 = arw_setStyle(value1, 0);
Attachments
Arrow_Pict.png
(7.02 KiB) Downloaded 420 times
Arrow.png
(9.09 KiB) Downloaded 415 times

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: Arrow Style seem not OK

Postby TJ » 18 Jul 2013

Hello
I want to display slim arrow's on my chart. Every value set on ARW_SetStyle return the same appearance.
Martin

Code: Select all

Value1 = arw_new_s(Date,Time_s, High+.0004,Arrowdown);
Value1 = arw_setcolor(value1, Blue);
Value1 = arw_setStyle(value1, 0);
Should I answer this question?

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Arrow Style seem not OK

Postby arjfca » 18 Jul 2013

Hello
I want to display slim arrow's on my chart. Every value set on ARW_SetStyle return the same appearance.
Martin

Code: Select all

Value1 = arw_new_s(Date,Time_s, High+.0004,Arrowdown);
Value1 = arw_setcolor(value1, Blue);
Value1 = arw_setStyle(value1, 0);
Should I answer this question?

hehe!

After 45 minutes turning around, your little remark made the trick....
Change for
Value1=
Value2 =
Value3 =


Martin :)

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: Arrow Style seem not OK

Postby sptrader » 18 Jul 2013

This version works for me.. (thought I'd give TJ a rest)..

Code: Select all

Value1 = arw_new_s(Date,Time_s, High+.0004,true);// true = down arrow, false = up arrow
Value2 = arw_setcolor(value1, Blue);
Value3 = arw_setStyle(value1, 0);

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: Arrow Style seem not OK

Postby TJ » 18 Jul 2013

hehe!
After 45 minutes turning around, your little remark made the trick....
Change for
Value1=
Value2 =
Value3 =
Martin :)
Martin:
You have to develop good coding habits... otherwise you will spend more time in debugging than in making money.

Here are my notes:

1. DO NOT use generic variable names (ie Value1, Condition1, etc.,). Always create a meaningful name, so that you can trace the origin of your values.
(the only time I use Value1 is if it is a throwaway variable. eg. in a loop)

2. in drawing objects, you don't need the assignments at all.
you could code as follow:

Code: Select all

arw_new_s(Date,Time_s, High+.0004,true);
The assignment to a variable is ONLY needed if you want to modify the object later.

Therefore you can skip Value2 and Value3 altogether:

Code: Select all

Sell.Arw = arw_new_s(Date,Time_s, High+.0004, Arrowdown);
arw_setcolor(Sell.Arw, Blue);
arw_setStyle(Sell.Arw, 0);


Return to “MultiCharts”