PVP indicator error  [SOLVED]

Questions about MultiCharts and user contributed studies.
madj0ker
Posts: 33
Joined: 11 Jan 2013

PVP indicator error

Postby madj0ker » 11 Jan 2013

I have a little problem with PVP indicator, i have this error code when Multicharts try to calculate it
Array bounds. Wrong index value: -100

this when the indicator is loaded on FESX future chart, on ES future chart work great. The code of PVP is

Code: Select all

{***********************************************************************************************

Coded by dbntina/boxmeister 8/9/2007

V1.01 8/11/2007 Blowfish changes eliminate scanning array every tick for PVP Volume update


***********************************************************************************************}



   [LegacyColorValue = true];

   vars:
      PriceDiff(0),
      StartPrice(0),
      PVPPrice(0),
      PVPVolume(0),
      V2VolLevel(0),
      Class("PVP"),
      InfoMap(MapSN.New);

   Array:
      PVPVolArray[3000] (0);
      
   if date > date[1] then begin
      StartPrice = AvgPrice;
      For Value1 = 0 to 3000 Begin
         PVPVolArray[Value1] = 0;
      End;
      PVPVolArray[1500] = Volume;
      PVPPrice = AvgPrice;
      PVPVolume = Volume;
   end;

   If date = date[1] And StartPrice > 0 Then Begin
      Value2 = AvgPrice - StartPrice;
      V2VolLevel = 1500+(Value2*(1/(minmove/pricescale)));
      PVPVolArray[V2VolLevel] = PVPVolArray[V2VolLevel] + Volume;
      {PVPVolume = 0;
      PVPPrice = 0;

      For Value1 = 0 to 3000 Begin
         If PVPVolArray[Value1] > PVPVolume Then Begin
            PVPVolume = PVPVolArray[Value1];
            PriceDiff = 1500-Value1;
            PVPPrice = StartPrice - (PriceDiff*(minmove/pricescale));
         End
         Else Begin
            PVPVolume = PVPVolume;
            PVPPrice = PVPPrice;
         End;
      End;}

      If PVPVolArray[V2VolLevel] > PVPVolume Then Begin
         PVPVolume = PVPVolArray[V2VolLevel];
         PriceDiff = 1500-V2VolLevel;
         PVPPrice = StartPrice - (PriceDiff*(minmove/pricescale));
      End;

   End;

   Value1 = MapSN.Put(InfoMap, "PVP", PVPPrice);
   Value1 = ADE.PutBarInfo(Class, GetSymbolName, ADE.TypeZeroInterval(11,1), ADE.BarID, InfoMap);

   Plot1(PVPPrice, "PVP");
   {Plot2(PVPVolume, "PVPVolume");}


i have tried with Multicahrts 8 and also with last 8.5 beta2 but the problem persists,the resolution is 1 tick. Thank you for your help
Attachments
error.jpg
error.jpg (29.94 KiB) Viewed 297 times

User avatar
TJ
Posts: 6609
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1912 times

Re: PVP indicator error

Postby TJ » 11 Jan 2013

madj0ker wrote:I have a little problem with PVP indicator, i have this error code when Multicharts try to calculate it

Array bounds. Wrong index value: -100...

i have tried with Multicahrts 8 and also with last 8.5 beta2 but the problem persists,the resolution is 1 tick. Thank you for your help


You should use the indicator on a minute chart.
Try 3 minutes minimum.

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: PVP indicator error

Postby madj0ker » 12 Jan 2013

Hi TJ, thank you for your reply, i have tried with minute charts but nothing, not work, the index value is more big. I need that PVP work with 1 tick resolution,always worked at that resolution, any idea because with other instruments work fine? Thank you for support
Attachments
error_with_3_minute.jpg
error_with_3_minute.jpg (30.17 KiB) Viewed 288 times

User avatar
TJ
Posts: 6609
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1912 times

Re: PVP indicator error

Postby TJ » 12 Jan 2013

try change VOLUME to TICKS

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: PVP indicator error

Postby madj0ker » 12 Jan 2013

same problem

User avatar
TJ
Posts: 6609
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1912 times

Re: PVP indicator error

Postby TJ » 12 Jan 2013

Please check your data: make sure FESX has volume.

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: PVP indicator error

Postby madj0ker » 13 Jan 2013

i have verified all parameters, but dont work. Tomorrow i try delete old data and build new FESX database and i tell you if solves the problem

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: PVP indicator error

Postby madj0ker » 14 Jan 2013

Hi TJ, was a problem of historical data, with new data all work correctly, thank you.

User avatar
TJ
Posts: 6609
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1912 times

Re: PVP indicator error

Postby TJ » 14 Jan 2013

madj0ker wrote:Hi TJ, was a problem of historical data, with new data all work correctly, thank you.


and you are saying ES future chart work great? only the FESX future chart giving problem?

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: PVP indicator error

Postby madj0ker » 14 Jan 2013

Yes TJ, ES chart don't have any problem.

User avatar
TJ
Posts: 6609
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1912 times

Re: PVP indicator error

Postby TJ » 14 Jan 2013

madj0ker wrote:Yes TJ, ES chart don't have any problem.

Then the problem is in the data, not the code.

(Unless you have modified the code, which you have not told us.)


Please try it on another symbol to see if the same code works?

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: PVP indicator error

Postby madj0ker » 14 Jan 2013

Shit! With DAX same problem,
Array bounds. Wrong index value: -3050
, ES chart work and now FESX more same problem,only on EUREX market have this problem, what is wrong? I do not understand

User avatar
TJ
Posts: 6609
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1912 times

Re: PVP indicator error  [SOLVED]

Postby TJ » 14 Jan 2013

madj0ker wrote:Shit! With DAX same problem,
Array bounds. Wrong index value: -3050
, ES chart work and now FESX more same problem,only on EUREX market have this problem, what is wrong? I do not understand


What settings do you have for minmove and pricescale?

(check in QM)

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: PVP indicator error

Postby madj0ker » 14 Jan 2013

Price scale 1/100 and min movement 1...with price scale
As is
work...GREAT!!!


Return to “MultiCharts”