Announcement

Collapse
No announcement yet.

how to create a series by merging two existing series (eg close and high)?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to create a series by merging two existing series (eg close and high)?

    Hi All,
    I would like to build a data series that I can use to test RSI values.
    To do that I would like to create a series with 300-400 datapoints (minimum required for accurate rsi calculation) or more using an instrument's <close> values (in 5min or 15min or whatever interval), but then for the last datapoint I would like to replace the <close> value with the latest <high> or <low> value, or even a value that I input myself manually.

    Could anyone show me some script that 'blends' the close series with the high or low series, at a required juncture - in this case just swapping in the latest high value for the close value in the series/array? Or that allows an override of the latest close value via manual input?
    I have some experience of creating series and objects to create indicators but am at a loss when it comes to the above and handling arrays efficiently in esignal.
    many thanks! PC

  • #2
    rephrasing of problem

    Not sure how much sense my original question made so I am rephrasing to see if anyone can suggest a way of doing the following.

    My aim is to know for the upcoming bar if, as it hits a certain target price, that price will mean RSI has gone overbought/sold, eg RSI going above 70 or below 30 at the next bar.
    I have not worked out a way to do that in efs as yet. (I can export the last 300+ close price datapoints to excel and calculate Rsi in excel, which is what i am currently doing, but that does not allow a quick calculation as is cumbersome to export the data, nor can it be integrated with an automated program).

    I thought perhaps if I could create an array of 400 datapoints (minimum number required for an accurate RSI calculation) using the previous 399 close values from my security, plus one last value which can be input (eg via an edit studies input parameter) so that my array looks as follows:
    Datapoints -400 to -1: my security's most recent 399 close values; datapoint 0: my input price (to test)

    ...and then pass my array through the rsi function to see what rsi will be if the next bar does close at the input price at point zero.

    Is this feasible? If anyone can suggest a way to do that I would be grateful.

    many thanks PC

    Comment

    Working...
    X