Python Forum
Cant access variable from anywhere
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cant access variable from anywhere
#15
From your latest post it looks like there is another loop that you are not showing (index). Is all the code from your last post inside another loop? If so, there is no need to make fibo a function. It will update each time the loop executes.
cma = 0
for index in range(whatever):
    fibo = (max_close - (3853.5)) / (max_close - cma)  # Will use current cma value, not always zero.
    sumvolfibo = sm / fibo()

    foundIndex = 0
    som = 0
    for i in range(index,810):
        som += vol_list[i]
        if som >= sumvolfibo:
            foundIndex = i
            break

    # do something that calculates a new cma value
Reply


Messages In This Thread
Cant access variable from anywhere - by Frankduc - Nov-01-2022, 12:51 PM
RE: Cant access variable from anywhere - by rob101 - Nov-01-2022, 01:04 PM
RE: Cant access variable from anywhere - by rob101 - Nov-01-2022, 01:29 PM
RE: Cant access variable from anywhere - by deanhystad - Nov-01-2022, 08:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  sharepoint: Access has been blocked by Conditional Access policies CAD79 0 2,251 Jul-12-2024, 09:36 AM
Last Post: CAD79
  Can we access instance variable of parent class in child class using inheritance akdube 3 15,805 Nov-13-2020, 03:43 AM
Last Post: SalsaBeanDip
  Access a variable of a daemon peek_no_boo 8 4,903 Apr-03-2020, 07:29 PM
Last Post: BrendanD
  How to access class variable? instances vs class drSlump 5 4,415 Dec-11-2019, 06:26 PM
Last Post: Gribouillis
  How can I access this variable from a def? student3m 1 3,505 Sep-23-2017, 02:06 PM
Last Post: ichabod801
  Can access class private variable? Michael 2 8,215 Aug-11-2017, 01:59 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020