NexusFi: Find Your Edge


Home Menu

 





EasyLanguage VWAP code help


Discussion in Platforms and Indicators

Updated
      Top Posters
    1. looks_one MilesT with 4 posts (4 thanks)
    2. looks_two olobay with 3 posts (0 thanks)
    3. looks_3 treydog999 with 2 posts (3 thanks)
    4. looks_4 ABCTG with 1 posts (0 thanks)
    1. trending_up 20,813 views
    2. thumb_up 10 thanks given
    3. group 7 followers
    1. forum 12 posts
    2. attach_file 1 attachments




 
Search this Thread
  #11 (permalink)
csayantan
kolkata+WB/Country
 
Posts: 22 since Dec 2013
Thanks Given: 10
Thanks Received: 4

Hi

i got floating point invalid operation.
can you re-fix it?

Thx
CS


Reply With Quote
  #12 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

CS,

this usually happens when the code tries to divide by 0. You can fix this by adding checks to each division making sure the divisor is not zero. For example there are several division done by Totalvolume.
Adding
 
Code
if Totalvolume <> 0 then ...
will fix that in this case.

Regards,
ABCTG


csayantan View Post
Hi

i got floating point invalid operation.
can you re-fix it?

Thx
CS


Follow me on X Reply With Quote
  #13 (permalink)
 
tturner86's Avatar
 tturner86 
Portland, Oregon
Market Wizard
 
Experience: Intermediate
Platform: F-16CM-40
Trading: GBU-39
Posts: 6,190 since Sep 2013
Thanks Given: 10,460
Thanks Received: 12,695

Just found this easy code and was able to make it work in OEC.

Inputs:Time_Start(0000);
vars:
PriceW(0),
ShareW(0),
bb(0),
vwap(0);

if date > date[1] then begin
PriceW = 0;
ShareW = 0;
end;

value1= (open+high+low+close)/4;

bb=volume;

if time > time_start then begin
PriceW = pricew + value1*bb;
ShareW = ShareW + bb;
vwap = PriceW / ShareW;
end;

Plot1(vwap);


Visit my NexusFi Trade Journal Reply With Quote




Last Updated on April 18, 2014


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts