NexusFi: Find Your Edge


Home Menu

 





Different value for close vs PriceSeriesPrive1.Close[0]


Discussion in EasyLanguage Programming

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




 
Search this Thread

Different value for close vs PriceSeriesPrive1.Close[0]

  #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?
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
Could it be that currency futures are way easier to trade?
Currencies
 
  #3 (permalink)
 
AllSeeker's Avatar
 AllSeeker 
Mumbai, India
Legendary Pratik_4Clover
 
Experience: Beginner
Platform: TradingView & ZerodhaKite
Trading: NIFTY, BANKNIFTY
Frequency: Daily
Duration: Minutes
Posts: 1,424 since Jan 2019
Thanks Given: 5,249
Thanks Received: 5,012


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,527


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,664 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,359


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 Twitter Reply With Quote




Last Updated on March 25, 2020


© 2024 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 - Privacy Policy - Downloads - Top
no new posts