Help setting this code for data2 dollar % trail

Questions about MultiCharts and user contributed studies.
willwill7
Posts: 29
Joined: 15 Jun 2008

Help setting this code for data2 dollar % trail

Postby willwill7 » 13 Dec 2008

This code is not picking up on data2, which is set at 1 tic. I've tried several other ways, but can't seem to make it work. Any help much appreciated.

Thank you!


Inputs:
DLRS(1000), { Opt 500/1000/10 }
PCT(7); { Opt 7/20/.1 }

Variables: MP2(0);
MP2 = Marketposition data2;

If MP2 = -1 then begin
setstopposition data2;
setpercenttrailing(DLRS data2, PCT data2);
End;

If MP2 = 1 then begin
setstopposition data2;
setpercenttrailing(DLRS data2, PCT data2);
End;

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

Postby TJ » 13 Dec 2008

you can only autotrade on data1.

willwill7
Posts: 29
Joined: 15 Jun 2008

Postby willwill7 » 13 Dec 2008

Thank TJ -

How about back testing using data2?

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 18 Dec 2008

Hi willwill7,

Strategies can reference values coming from price series other than data1. However, orders can only be generated on data1 (both for auto trading and backtesting).

Regards.


Return to “MultiCharts”