Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pointer to DataSeries Object

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

    Pointer to DataSeries Object

    Hi,

    I'm using DrawRegion() but the dataseries that I want to shade between depend on input parameters, and they are moving averages.

    Is there a way that I could create a dataseries pointer, set it to point the EMA series that I need during intialization(), then use the pointer in DrawRegion()?

    so something like this...

    DataSeries MyDataseries1, MyDataSeries2;

    Initialize() {
    MyDataseries1 = EMA(21); // this doesnt compile
    MyDataseries2 = WMA(12); // this doesnt compile
    }

    OnBarUpdate()
    {
    DrawRegion("tag"+CurrentBar.ToString(), 1, 0, MyDataSeries1, MyDataSeries2, colour, colour, opacity);
    }

    Thanks,
    will.

    #2
    Hi Will, to compile that snippet please try making the series IDataSeries, so

    IDataSeries MyDataseries1, MyDataseries2;

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    27 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    17 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    9 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    10 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    17 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X