Load more than 300 bars?

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

Load more than 300 bars?

Postby jellison » Thu Jan 24, 2019 2:47 pm

I have written an indicator to draw support and resistance lines. I would like it to be able to look back more than the 300 bars that are loaded by default. Does anyone know how to achieve this?
jellison
 
Posts: 2
Joined: Wed Nov 21, 2018 8:02 am

Re: Load more than 300 bars?

Postby Alexander.Gettinger » Mon Jan 28, 2019 12:00 pm

How do you load the data?
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3566
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

Re: Load more than 300 bars?

Postby jellison » Mon Jan 28, 2019 5:16 pm

Through the standard indicator framework (skeletal code below) - I can't get any data if history_length is greater than 300.

Code: Select all
function Prepare()

    source = instance.source;
    first = source:first();

    ...

end

 
function Update(period, mode)
       
    start_date = source:date(period - history_length);
   
    ...

end


jellison
 
Posts: 2
Joined: Wed Nov 21, 2018 8:02 am

Re: Load more than 300 bars?

Postby Alexander.Gettinger » Tue Jan 29, 2019 2:54 pm

Your indicator takes data from the chart and it can use as much data as you downloaded to the chart.
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3566
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk


Return to Discussions

Who is online

Users browsing this forum: No registered users and 6 guests