Initialize an array of 'close' data of a security

#1
Can you help me out?

During AFL coding, how can i initialize an array of 'close' data of a specific security of interest at any particular moment?

My solution: function "foreign"
Is there a better and more appropriate function ???

I remain.

Mike-Ekwueme (respartner)

N.B: i am an AFL coding beginner....
 

mastermind007

Well-Known Member
#2
Can you help me out?

During AFL coding, how can i initialize an array of 'close' data of a specific security of interest at any particular moment?

My solution: function "foreign"
Is there a better and more appropriate function ???

I remain.

Mike-Ekwueme (respartner)

N.B: i am an AFL coding beginner....
There is a pre-defined array Close (abbreviated as C), which contains value of Close price of the symbol you are currently plotting on chart (or considering in analysis/scanning/backtesting). You need not write even one line of code to accomplish this.

When you want to see price of any other symbol without actually loading it into a chart, you may use Foriegn or SetForeign (paired with RestorePrice...) function.

In order to lookup a particular value, you can use ValueWhen(..) IIf(....) Lookup or by working out bar index of the desired point and then using that as array-indexer to retrieve the particular value.
 

Similar threads