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 21,510 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

Can you help answer these questions
from other members on NexusFi?
Ninjatrader users - good CONNECTIONs post and article fr …
NinjaTrader
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Thanks Mike. Godspeed.
The Elite Circle
Would a node-based workflow for automated trading be useful?
Traders Hideout
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
  #12 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

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,192 since Sep 2013
Thanks Given: 10,461
Thanks Received: 12,699


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