LastBarOnChart print command not working with stop orders

Questions about MultiCharts and user contributed studies.
faraz
Posts: 144
Joined: 25 Feb 2011
Has thanked: 26 times
Been thanked: 57 times

LastBarOnChart print command not working with stop orders

Postby faraz » 19 May 2012

Hi,

Is there any way to make LastBarOnChart print work with stop orders like this below example;

Code: Select all

if (average(c,10)>c)then buy tomorrow at open tomorrow + 0.00001 stop;

if (average(c,10)<c)then sell short tomorrow at open tomorrow - 0.00001 stop;

if LastBarOnChart then print(d);

Thanks

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

Re: LastBarOnChart print command not working with stop order

Postby TJ » 19 May 2012

Hi,

Is there any way to make LastBarOnChart print work with stop orders like this below example;

Code: Select all

if (average(c,10)>c)then buy tomorrow at open tomorrow + 0.00001 stop;

if (average(c,10)<c)then sell short tomorrow at open tomorrow - 0.00001 stop;

if LastBarOnChart then print(d);

Thanks

Your code does not tell us your intention.

You need to describe in detail (with timeline) exactly what do you want to do.

faraz
Posts: 144
Joined: 25 Feb 2011
Has thanked: 26 times
Been thanked: 57 times

Re: LastBarOnChart print command not working with stop order

Postby faraz » 19 May 2012


Your code does not tell us your intention.

You need to describe in detail (with timeline) exactly what do you want to do.
Like what u want to know?

faraz
Posts: 144
Joined: 25 Feb 2011
Has thanked: 26 times
Been thanked: 57 times

Re: LastBarOnChart print command not working with stop order

Postby faraz » 20 May 2012

Found the solution instead of

LastBarOnChart

for back testing purposes
d >= 1120517


if require for live data then could use like this
currentdate >= d


or this is the best i liked;
if d + 1 = JulianToDate( LastCalcJDate ) then print(d);



hope this helps if any body needed.


Return to “MultiCharts”