Arw_New_self_DT(date,114843257,1.2895,false); Not compile  [SOLVED]

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

Arw_New_self_DT(date,114843257,1.2895,false); Not compile

Postby arjfca » 23 May 2013

Hello

The new function Arw_New_self_DT(date,114843257,1.2895,false);

value1 = Arw_New_self_DT(date,114843257,1.2895,false);
Error given is
Compiled with error(s): ------
Invalid number of parameters. 3 parameter(s) expected
errLine 57, errColumn 15, errLineEnd 57, errColumnEnd 15
causal study: (Function)
The new function expect 3 parameters while the equivalent Arw_New_self_S expect 4 parameters. How do I resolve that?

Martin :)

User avatar
ABC
Posts: 721
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Arw_New_self_DT(date,114843257,1.2895,false); Not compil  [SOLVED]

Postby ABC » 23 May 2013

Hi Martin,

doesn't _DT mean that the reserved uses a datetime input? Which would mean you have one input for time and date only.

Regards,
ABC

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

Re: Arw_New_self_DT(date,114843257,1.2895,false); Not compil

Postby arjfca » 23 May 2013

Hi Martin,

doesn't _DT mean that the reserved uses a datetime input? Which would mean you have one input for time and date only.

Regards,
ABC
Good day Sir
Problem half way resolved. Finally, I'm able to show an arrow at the position that I "Shift click "on the chart. Only problem, the arrow disappear by itself few second later or when I click on the chart ( not using the SHIFT click)

Martin

Code: Select all

[ProcessMouseEvents = true]

vars:
Comma (""),
vClickBarHigh_S (""),
vClickBarLow_S (""),
vClickBarOpen_S (""),
vClickBarClose_S (""),
vClickBarNbr(0),
vLastBar(0),
vBarsAgo(0),
vClickBarHigh(0),
vClickBarLow(0),
vClickBarOpen (0),
vClickBarClose (0),
vClickPrice (0),
vclickdatetime (0),
vclickDateTime_S (""),
AmouseClick (false),
ClickTime (0),
clickDate (0),
UpArrow (True),
BarNumberTarget (0);

Once Comma = ",";
if MouseClickshiftPressed then begin
Amouseclick = True;
vClickBarNbr = MouseClickBarNumber;
vclickdatetime = MouseClickDateTime;
vClickPrice = MouseClickPrice;
end;
If amouseclick = true then begin
vLastBar = BarNumber + MaxBarsBack;
vBarsAgo = vLastBar-vClickBarNbr ;

if vBarsAgo >= 0 then begin
vclickbarhigh = high[vBarsAgo];

vClickBarOpen_S = NumtoStr(Open[vBarsAgo],5);
vClickBarHigh_S = NumToStr(high[vBarsAgo],5);
vClickBarLow_S = NumToStr(low[vBarsAgo],5);
vClickBarClose_S = NumToStr(Close[vBarsago],5);

GvSetNamedString("BarInfo",vClickBarOpen_S + comma + vClickBarHigh_S + comma + vClickBarLow_s + comma + vClickBarClose_S);

value1 = Arw_New_DT(vclickdatetime,vClickPrice ,false);

end;
end;

If amouseclick = true and lastbaronchart_S then amouseclick = false;

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Arw_New_self_DT(date,114843257,1.2895,false); Not compil

Postby TJ » 23 May 2013

Hi Martin,

doesn't _DT mean that the reserved uses a datetime input? Which would mean you have one input for time and date only.

Regards,
ABC
Good day Sir
Problem half way resolved. Finally, I'm able to show an arrow at the position that I "Shift click "on the chart. Only problem, the arrow disappear by itself few second later or when I click on the chart ( not using the SHIFT click)

Martin

Code: Select all

[ProcessMouseEvents = true]

vars:
Comma (""),
vClickBarHigh_S (""),
vClickBarLow_S (""),
vClickBarOpen_S (""),
vClickBarClose_S (""),
vClickBarNbr(0),
vLastBar(0),
vBarsAgo(0),
vClickBarHigh(0),
vClickBarLow(0),
vClickBarOpen (0),
vClickBarClose (0),
vClickPrice (0),
vclickdatetime (0),
vclickDateTime_S (""),
AmouseClick (false),
ClickTime (0),
clickDate (0),
UpArrow (True),
BarNumberTarget (0);

Once Comma = ",";
if MouseClickshiftPressed then begin
Amouseclick = True;
vClickBarNbr = MouseClickBarNumber;
vclickdatetime = MouseClickDateTime;
vClickPrice = MouseClickPrice;
end;
If amouseclick = true then begin
vLastBar = BarNumber + MaxBarsBack;
vBarsAgo = vLastBar-vClickBarNbr ;

if vBarsAgo >= 0 then begin
vclickbarhigh = high[vBarsAgo];

vClickBarOpen_S = NumtoStr(Open[vBarsAgo],5);
vClickBarHigh_S = NumToStr(high[vBarsAgo],5);
vClickBarLow_S = NumToStr(low[vBarsAgo],5);
vClickBarClose_S = NumToStr(Close[vBarsago],5);

GvSetNamedString("BarInfo",vClickBarOpen_S + comma + vClickBarHigh_S + comma + vClickBarLow_s + comma + vClickBarClose_S);

value1 = Arw_New_DT(vclickdatetime,vClickPrice ,false);

end;
end;

If amouseclick = true and lastbaronchart_S then amouseclick = false;

if you have clicked the mouse and draw an arrow,
what will happen if the last line executes before the end of the bar?
what will be the value of amouseclick ?

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

Re: Arw_New_self_DT(date,114843257,1.2895,false); Not compil

Postby arjfca » 23 May 2013

TJ,

Amouseclick will be false

My understanding was that once an arrow was draw, it will be kept there forever or until manually kill from the chart. I realize now that it should be re-enabled on every pass.

I did try to put the draw arrow function outside of the loop, but it was slowing down my charts

Since, for the moment, the arrow is just a temporary visual indicator for me, I will not investigate further. The bar data collected with the mouseclick is saved in a global variable. This variable is then use in Excel to transfer data to my sheet without me typing the data.

Martin

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Arw_New_self_DT(date,114843257,1.2895,false); Not compil

Postby TJ » 23 May 2013

TJ,

Amouseclick will be false

My understanding was that once an arrow was draw, it will be kept there forever or until manually kill from the chart. I realize now that it should be re-enabled on every pass.
...
the arw will be kept forever if the condition is true at the end of the bar.


Return to “MultiCharts”