NexusFi: Find Your Edge


Home Menu

 





Different value for close vs PriceSeriesPrive1.Close[0]


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Silvester17 with 1 posts (0 thanks)
    2. looks_two kevinkdog with 1 posts (3 thanks)
    3. looks_3 ifcontech with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 2,294 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
ifcontech
Kuala Lumpur Malaysia
 
Posts: 4 since Jun 2019
Thanks Given: 0
Thanks Received: 1

I am confused

why do i got different result when i put in the following code


average1 = average(close,15);
average2 = average(PriceSeriesProvide1.Close[0],15);

Print(average1,average2);


i got two different value for close vs PriceSeriesProvide1.Close[0]

it put under the same interval.


anyone can clarify?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
Beijing Summit Closes: Xi Pledges Hormuz Help -- $1.14B …
Prediction Markets & Event Contracts
CFTC Approves First US Bitcoin Perpetual Futures -- Kals …
Traders Hideout
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 
AllSeeker's Avatar
 AllSeeker 
Mumbai, India
 
Experience: Beginner
Platform: TradingView & ZerodhaKite
Trading: NIFTY, BANKNIFTY
Frequency: Daily
Duration: Minutes
Posts: 1,533 since Jan 2019
Thanks Given: 5,601
Thanks Received: 5,315


Well, since no one has yet replied, first look at the code suggests your problem is here
Quoting 
average2 = average(PriceSeriesProvide1.Close[0],15)

That means you are importing current bars close, which is not yet closed so it will also repaint. Which is different from the average1 calculation.

Please note here I'm only commenting due to similarity of this part with Pine, I do not code in easy language. You can try changing the 0 to 1 and see if they match but then again it wont have any purpose.

Hope that helped, if not please ignore


Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
Silvester17's Avatar
 Silvester17 
Columbus, OH
Market Wizard
 
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,531


ifcontech View Post
I am confused

why do i got different result when i put in the following code


average1 = average(close,15);
average2 = average(PriceSeriesProvide1.Close[0],15);

Print(average1,average2);


i got two different value for close vs PriceSeriesProvide1.Close[0]

it put under the same interval.


anyone can clarify?

could it be that one is the last traded price (2442.50) and the other the settlement price (2438)?

https://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp500_quotes_settlements_futures.html



Reply With Quote
  #5 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,737 since Jul 2012
Thanks Given: 1,917
Thanks Received: 7,476


ifcontech View Post
I am confused

why do i got different result when i put in the following code


average1 = average(close,15);
average2 = average(PriceSeriesProvide1.Close[0],15);

Print(average1,average2);


i got two different value for close vs PriceSeriesProvide1.Close[0]

it put under the same interval.


anyone can clarify?

why don't you include:

print(close," ",PriceSeriesProvide1.Close[0]);

in your code to see what each is using?


Follow me on X Reply With Quote




Last Updated on March 25, 2020


© 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