Big issue with the bar magnifier [FIXED]

Questions about MultiCharts and user contributed studies.
duration
Posts: 175
Joined: 20 Dec 2005

Big issue with the bar magnifier [FIXED]

Postby duration » 05 Jun 2010

Hello,

TO FIX IT: start regedit, go to shaper and change maxbarscount to a higher value (20,000,000 worked for me, it seems higher values would make the software unstable)

I believe I have found an issue with the bar magnifier.

Here is a short signal I wrote:

Code: Select all

value1 = xaverage( close, 10 ) ;
value2 = xaverage( close, 20 ) ;

condition1 = date <> 1100507 and date <> 1100402 and date <> 1100305 and date <> 1100205 and date <> 1100101 ;

if condition1 and value1 crosses above value2 then buy this bar on close ;

if condition1 and value1 crosses below value2 then sellshort this bar on close ;
setprofittarget( 100 ) ;


When backtested without bar magnifier, no problem. When the bar magnifier is on (1 TICK resolution), condition1 is ignored and the trades are not plotted correctly.

Please have a look on the screenshots.

Many thanks,
Attachments
with bar magnifier.png
with bar magnifier.png (247.08 KiB) Viewed 219 times
without bar magnifier.png
without bar magnifier.png (160.72 KiB) Viewed 224 times
Last edited by duration on 07 Jun 2010, edited 1 time in total.

User avatar
Henrik
Posts: 140
Joined: 13 Apr 2010
Has thanked: 25 times
Been thanked: 11 times

Postby Henrik » 05 Jun 2010

Downloaded Ticks or realtime-recorded ticks?

User avatar
TJ
Posts: 6521
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 05 Jun 2010

regarding this line:

condition1 = date <> 1100507 and date <> 1100402 and date <> 1100305 and date <> 1100205 and date <> 1100101 ;

what would be the value of condition1 on the following dates?
1100506
1100507
1100508


ps. generic variable name will always get you.

duration
Posts: 175
Joined: 20 Dec 2005

Postby duration » 05 Jun 2010

Downloaded Ticks or realtime-recorded ticks?


Hi Henrik,

It is offline ASCII data, coming from real-time recorded ticks.
Last edited by duration on 05 Jun 2010, edited 1 time in total.

duration
Posts: 175
Joined: 20 Dec 2005

Postby duration » 05 Jun 2010

regarding this line:

condition1 = date <> 1100507 and date <> 1100402 and date <> 1100305 and date <> 1100205 and date <> 1100101 ;

what would be the value of condition1 on the following dates?
1100506
1100507
1100508


ps. generic variable name will always get you.


Hi TJ,

I know you don't like generic variables :)

I wrote this very quickly to test the bar magnifier, but I believe the value would be:

1100506 FALSE
1100507 TRUE
1100508 FALSE

?

User avatar
TJ
Posts: 6521
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 05 Jun 2010

regarding this line:

condition1 = date <> 1100507 and date <> 1100402 and date <> 1100305 and date <> 1100205 and date <> 1100101 ;

what would be the value of condition1 on the following dates?
1100506
1100507
1100508


ps. generic variable name will always get you.


Hi TJ,

I know you don't like generic variables :)

I wrote this very quickly to test the bar magnifier, but I believe the value would be:

1100506 FALSE
1100507 TRUE
1100508 FALSE

?


I don't think the big issue is with the bar magnifier,
but in your condition1.
... you should take a closer look at your logic.



A meaningful variable name can help you visualize your logic;
you will spend less time running around in circles (debugging),
and more time running your strategy.

duration
Posts: 175
Joined: 20 Dec 2005

Postby duration » 06 Jun 2010

Hi TJ,

Would it be :

1100506 TRUE
1100507 TRUE
1100508 FALSE

?

Because a general variable is true by default?

User avatar
TJ
Posts: 6521
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 06 Jun 2010

Hi TJ,

Would it be :

1100506 TRUE
1100507 TRUE
1100508 FALSE

?

Because a general variable is true by default?



you should always test the value with a plot before proceeding to buy/sell orders.

e.g. (set the plot to a large red dot)

Code: Select all

if condition1 = true then plot10( close, "cond1=true")
else noplot(10);

User avatar
TJ
Posts: 6521
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Postby TJ » 06 Jun 2010

...
Because a general variable is true by default?



There is no default value.

Once you have set the logic,
the condition is constantly re-evaluated.
There can be only one of 2 outcomes:
either True, or False.

duration
Posts: 175
Joined: 20 Dec 2005

Postby duration » 07 Jun 2010

Hi TJ,

I use the following:


Code: Select all

condition1 = date <> 1100507 and date <> 1100402 and date <> 1100305 and date <> 1100205 and date <> 1100101 ;

if condition1 = true then plot10( close, "cond1=true")
else noplot(10);


And it plots a flat line at 1100507, 1100402, 1100305, 1100205 & 1100101.

I think it is working correctly no?

Sorry I don't see why the general variable cannot do the job :(


Return to “MultiCharts”