Skip This Ad >>
 
Register
Forgotten your password?
Forex-TSD - Powered by vBulletin
Loading search...
Advanced search
  • Home
  • Forums
    • Free sections
    • Exclusive sections
    • All sections
  • More Recent
    • Latest Threads
    • Today's Posts
  • Brokers Center
    • Find your broker
    • Open a Demo Account
    • Contact a Broker
    • Brokers support
  • Calendar
  • Register
    • Create new account
  • Quick Links
    • View Forum Leaders
    • Follow Users
    • Hottest Threads / Posts
    • Thanks / Like Statistics
  • Advertising
  • Blog
  • Premium Forum
Pay Per Download
  • Free access to all exclusive talks
  • Look for the files you need
  • Select the file and download
Elite Membership
  • Elite Trading System
  • Propietary Indecators
  • Elite Expert Advisors
Advanced Membership
  • All Elite benefits, plus:
  • - MT5 cutting-edge indicators.
  • - MT4 to MT5 Conversions
  • - 24/5 Trading Support!


  • Home
  • Forum
  • Debates & Discussions
  • Indicators, Expert Systems and Tools
  • Metatrader 4
  • MetaTrader Programming
  • VPCI Indicator. What's wrong? (Tradestation to MT4)

Like Tree1Likes
  • Top
  • All
  • This Page
  • 1 Post By mladen

Thread: VPCI Indicator. What's wrong? (Tradestation to MT4)



  • LinkBack
    • LinkBack URL LinkBack URL
    • About LinkBacks About LinkBacks
    •  
    • Bookmark & Share
    • Digg this Thread!
    • Add Thread to del.icio.us
    • Bookmark in Technorati
    • Tweet this thread
  • Thread Tools
    • Show Printable Version
    • Email this Page…
    • Subscribe to this Thread…
  • Display
    • Switch to Hybrid Mode
    • Switch to Threaded Mode
Results 1 to 5 of 5
4 4 Attachment(s)

  1. 01-06-2013 02:18 AM #1
    JoeMcCool
    JoeMcCool is offline Junior Member
    Join Date
    Feb 2011
    Posts
    7
    Points
    22
    Credits
    0
    Post Thanks / Like
    Thanks (Given)
    0
    Thanks (Received)
    0
    Likes (Given)
    0
    Likes (Received)
    0
    Dislikes (Given)
    0
    Dislikes (Received)
    0
    vBActivity - Stats
    Points
    22
    Level
    2
    vBActivity - Bars
    Lv. Percent
    2.67%
    Daily Activity
    2.67%
    Weekly Activity
    2.28%
    Monthly Activity
    1.55%
    Follows
    0
    Following
    0
    Follow

    VPCI Indicator. What's wrong? (Tradestation to MT4)

    Hello guys,
    i have found a VPCI indicator for tradestation and tried to code it for MT4, because i couldn't find a similar version. I took another VPCI (MT4) and just change a bit. i'm not that good at programming. Seems like it works but my MT4 version does not look like the tradesation version.

    Here is my Code (MT4):
    Code:
    #property indicator_separate_window
    #property indicator_buffers 1
    #property indicator_color1 Yellow
    
    extern int  period=5,
                LongTermPeriod=20,
    
    double VPCI[];
    double VPCISmooth[];
    int init() {
       string short_name="VPCI";
       SetIndexBuffer(0,VPCI);
       SetIndexStyle(0,DRAW_LINE);
       SetIndexLabel(0,"VPCI");
       IndicatorShortName(short_name+"("+period+","+LongTermPeriod+")");  
       return(0);
    }
     
    int start() {
       int counted_bars=IndicatorCounted();
       int limit=Bars-counted_bars;
       
       double VolumeSum1,VolumeSum2,VWMA1,VWMA2,VPR,VM,VolPriSum1,VolPriSum2,VP;
       for(int i=0;i<limit;i++) {
          VolumeSum1=0;
          for (int l=i;l<i+period;l++) {
             VolumeSum1+=Volume[l];
             }
          for (l=i;l<i+LongTermPeriod;l++) {
             VolumeSum2+=Volume[l];
             }
          
          for (l=i;l<i+period;l++) {
             VolPriSum1+=Volume[l]*Close[l];
             }
          for (l=i;l<i+LongTermPeriod;l++) {
             VolPriSum2+=Volume[l]*Close[l];
             }  
           
          if (VolumeSum1>0)
            VWMA1 = VolPriSum1/VolumeSum1;
          if (VolumeSum2>0)
            VWMA2 = VolPriSum2/VolumeSum2;   
           
          VP = VWMA2 - iMA(NULL,0,LongTermPeriod,0,0,0,i);
          VPR = VWMA1/ iMA(NULL,0,period,0,0,3,i);
          VM = (VolumeSum1/period)/(VolumeSum2/LongTermPeriod);
          
          VPCI[i]=VP * VPR * VM;
          }
          
       return(0);
    }
    And the tradestation code

    Code:
    inputs:
        Price( Close ),
        Length1( 5 ),
        Length2( 20 ),
        VPCIAvgLen( 20 ) ;
    variables:
        VolValue( 0 ),
        VolumeSum1( 0 ),
        VolumeSum2( 0 ),
        VWMA1( 0 ),
        VWMA2( 0 ),
        VP( 0 ),
        VPR( 0 ),
        VM( 0 ),
        VPCI( 0 ),
        AvgVPCI( 0 ) ;
    if BarType >= 2 then { not tick/minute data }
        VolValue = Volume
    else
        VolValue = Ticks ;
     
    VolumeSum1 = Summation( VolValue, Length1 ) ;
    if VolumeSum1 > 0 then
        VWMA1 = Summation( Price * VolValue , Length1 ) / VolumeSum1 ;
    VolumeSum2 = Summation( VolValue, Length2 ) ;
    if VolumeSum2 > 0 then
        VWMA2 = Summation( Price * VolValue , Length2 ) / VolumeSum2 ;
    VP = VWMA2 - Average( Price, Length2 ) ;
    VPR = VWMA1 / Average( Low, Length1 ) ;
    VM = Average( VolValue, Length1 ) / Average( VolValue, Length2 ) ;
    VPCI = VP * VPR * VM ;
    AvgVPCI = Average( VPCI, VPCIAvgLen ) ;
    Plot1( VPCI, "VPCI" ) ;
    Plot2( AvgVPCI, "VPCISmooth" ) ;
    Plot3( 0, "Zero" ) ;
    You can find a picture of it here: h**p://www.traderslaboratory.com/forums/attachments/56/5912d1207587090-volume-price-action-momentum-indicator-vpmo-vs-vpci-2008-04-07_124855.gif

    And here another one with the code under it: h**p://www.traders.com/Documentation/FEEDbk_docs/2007/07/TradersTips/TradersTips.html#tradestation

    I don't added the MA on it, don't know how to do it. If someone has the time it would be nice.
    But more important where is my mistake?

    THX
    Joe
    • Share
      • Share this post on
      • Digg
      • Del.icio.us
      • Technorati
      • Twitter
    Reply With Quote Reply With Quote

  2. 01-06-2013 06:24 AM #2
    mladen's Avatar
    mladen
    mladen is offline passenger
    Join Date
    Oct 2006
    Posts
    10,238
    Points
    12,806
    Credits
    15,537
    Post Thanks / Like
    Thanks (Given)
    13
    Thanks (Received)
    201
    Likes (Given)
    0
    Likes (Received)
    0
    Dislikes (Given)
    0
    Dislikes (Received)
    0
    vBActivity - Stats
    Points
    12,806
    Level
    33
    vBActivity - Bars
    Lv. Percent
    10%
    Daily Activity
    269.33%
    Weekly Activity
    407.84%
    Monthly Activity
    289.19%
    Follows
    7
    Following
    0
    Follow
    For now just posting this to add picture directly (so it is visible right away) and a link to description (to help all interested in in it : it is a TASC July 2007 description of it Traders Tips - July 2007 )
    Attached Thumbnails Attached Thumbnails vpmo vs vpci 2008-04-07_124855.gif  
    • Share
      • Share this post on
      • Digg
      • Del.icio.us
      • Technorati
      • Twitter
    "An error does not become a mistake until you refuse to correct it ... tradcode site , tradcode on facebook page and my facebook page ...
    Reply With Quote Reply With Quote

  3. 01-06-2013 07:26 AM #3
    mladen's Avatar
    mladen
    mladen is offline passenger
    Join Date
    Oct 2006
    Posts
    10,238
    Points
    12,806
    Credits
    15,537
    Post Thanks / Like
    Thanks (Given)
    13
    Thanks (Received)
    201
    Likes (Given)
    0
    Likes (Received)
    0
    Dislikes (Given)
    0
    Dislikes (Received)
    0
    vBActivity - Stats
    Points
    12,806
    Level
    33
    vBActivity - Bars
    Lv. Percent
    10%
    Daily Activity
    269.33%
    Weekly Activity
    407.84%
    Monthly Activity
    289.19%
    Follows
    7
    Following
    0
    Follow
    Was curios what will it look like on metatrader real data (and "volumes")
    It actually seems to be interesting on shorter time frames (this is a 15 minute metatrader data used for example)
    Attached Thumbnails Attached Thumbnails vpci.gif  
    • Share
      • Share this post on
      • Digg
      • Del.icio.us
      • Technorati
      • Twitter
    "An error does not become a mistake until you refuse to correct it ... tradcode site , tradcode on facebook page and my facebook page ...
    Reply With Quote Reply With Quote

  4. 01-06-2013 10:02 AM #4
    mladen's Avatar
    mladen
    mladen is offline passenger
    Join Date
    Oct 2006
    Posts
    10,238
    Points
    12,806
    Credits
    15,537
    Post Thanks / Like
    Thanks (Given)
    13
    Thanks (Received)
    201
    Likes (Given)
    0
    Likes (Received)
    0
    Dislikes (Given)
    0
    Dislikes (Received)
    0
    vBActivity - Stats
    Points
    12,806
    Level
    33
    vBActivity - Bars
    Lv. Percent
    10%
    Daily Activity
    269.33%
    Weekly Activity
    407.84%
    Monthly Activity
    289.19%
    Follows
    7
    Following
    0
    Follow

    VPCI - metatrader 4 version ...

    Here as a vpci indicator converted to metatrader 4 (with the addition of colors (as in this modified tradestation version : http://www.forex-tsd.com/tradestatio...tml#post482331)
    Attached Thumbnails Attached Thumbnails vpci.gif  
    Attached Files
    • File Type: mq4 vpci.mq4 (4.4 KB, 145 views)
    • Share
      • Share this post on
      • Digg
      • Del.icio.us
      • Technorati
      • Twitter
    AtApi likes this.
    "An error does not become a mistake until you refuse to correct it ... tradcode site , tradcode on facebook page and my facebook page ...
    Reply With Quote Reply With Quote

  5. 01-06-2013 02:24 PM #5
    JoeMcCool
    JoeMcCool is offline Junior Member
    Join Date
    Feb 2011
    Posts
    7
    Points
    22
    Credits
    0
    Post Thanks / Like
    Thanks (Given)
    0
    Thanks (Received)
    0
    Likes (Given)
    0
    Likes (Received)
    0
    Dislikes (Given)
    0
    Dislikes (Received)
    0
    vBActivity - Stats
    Points
    22
    Level
    2
    vBActivity - Bars
    Lv. Percent
    2.67%
    Daily Activity
    2.67%
    Weekly Activity
    2.28%
    Monthly Activity
    1.55%
    Follows
    0
    Following
    0
    Follow
    Thank you mladen,
    excellent work. i should have ask earlier, so i would not have spend so much time at my "beginner" code.

    I agree, it looks better in smaller timeframes but also not bad in higher. It could be helpfull, maybe in combination with other indicators or different settings.
    • Share
      • Share this post on
      • Digg
      • Del.icio.us
      • Technorati
      • Twitter
    Reply With Quote Reply With Quote

4 4 Attachment(s)

Quick Navigation MetaTrader Programming Top
  • Site Areas
  • Settings
  • Private Messages
  • Subscriptions
  • Who's Online
  • Search Forums
  • Forums Home
  • Forums
  • Announcements & Forex Press
    1. Announcements
    2. Financial News & Analytics
    3. Articles
      1. Success Stories
  • Debates & Discussions
    1. General Discussion
    2. Post and compare Trades
    3. Indicators, Expert Systems and Tools
      1. Metatrader 4
        1. MetaTrader Programming
        2. Metatrader 3
      2. Metatrader 5
      3. Documentation
      4. Tools and utilities
      5. Strategy Trader
      6. TradeStation
    4. Non Related Discussions
  • Trading Systems
    1. Ideas and Suggestions
    2. On the Move
    3. Graduated
      1. CatFx50
      2. Brain Systems
      3. Ema Cross
      4. Harmonic trading
      5. The "XO"-Method
      6. Phoenix
      7. Dolly
      8. Digital Filters
      9. Martingale/Average Cost and Hedging
  • Exclusive Forum
    1. Elite Section
    2. Advanced Elite
  • Commercial Talks
    1. Broker Talks
    2. Commercial Trading Systems and indicators
    3. Evaluate Commercial Ideas

» Popular Tags

123 pattern best indicator brokeragefactory coder coding help commodities commodity tips daily day trading demo account contest demo contest Double Top EA coder economic news elliott wave EUR/USD eurusd expert adviser expert advisor

» Rankings

Hottest Threads

1  Eurusd/gbpusd
2  CatFx50
3  Elite indicators :)
4  Indicators with alerts/signal
5  10points 3.mq4

view more
 

Most Popular Threads

1  Multi Timeframe In...
2  Eurusd/gbpusd
3  Something interesting pl...
4  CatFx50
5  The Murrey Math Trading System

view more


« Previous Thread | Next Thread »

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can someone convert indicator from Tradestation to MT4?
    By dasio in forum MetaTrader Programming
    Replies: 1
    Last Post: 12-24-2012, 08:09 AM
  2. TTF+MW Indicator - Any idea what's wrong?
    By disavowed in forum Metatrader 4
    Replies: 5
    Last Post: 02-12-2008, 08:04 AM
  3. What's wrong? Please go through it
    By cobby in forum Metatrader 4
    Replies: 1
    Last Post: 08-09-2007, 10:11 PM
  4. What is wrong here ????
    By junglelion in forum Metatrader 4
    Replies: 6
    Last Post: 06-24-2007, 06:27 PM
  5. What's wrong with this EA ?
    By rjay in forum Metatrader 4
    Replies: 1
    Last Post: 12-16-2006, 12:30 AM

Tags for this Thread

  • vpci indicator mt4

View Tag Cloud

Bookmarks

Bookmarks
  • Submit to Digg Digg
  • Submit to del.icio.us del.icio.us
  • Submit to Technorati Technorati
  • Submit to Furl Furl
  • Submit to StumbleUpon StumbleUpon
  • Submit to Reddit Reddit
  • Submit to Facebook Facebook
  • Submit to Blink List Blink List
  • Submit to Google Google
  • Submit to Yahoo My Web Yahoo My Web
  • Submit to Twitter Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off
  • Trackbacks are On
  • Pingbacks are On
  • Refbacks are On

Forum Rules

Forums
  • Free sections
  • Exclusive sections
  • All sections
Brokers Center
  • Find your broker
  • Open a Demo Account
  • Contact a Broker
  • Brokers support
Calendar Social Networking
Premium Forum
  • Elite Membership
  • Advanced Membership
All times are GMT. The time now is 11:06 PM.
Terms and Conditions | PRIVACY POLICY | CONTACT US | FAQ
Powered by vBulletin® Version 4.1.11
Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO
Image resizer by SevenSkins
Copyright 2005-2013 Forex-TSD
Digital Point modules: Sphinx-based search

Pay per download

All Elite and Advanced content is now reachable for FREE!
  • Search through thousands exclusive files
  • Choose and pay for the files you need
  • Professional quality made indicators
  • Working guarantee and dedicated support
or