IF Statement in Custom Code

Hi everyone,
I try to use an IF statement in a Custom Code. The use is that the Code shows the Data from one symbol up to a certain date and aferwards another symbol’s data.

V1 = STRDATE(DATE=2019-06-27) ;
// use 0QR4 before V1 date and NESR.GR afterwards
IF (BARDATE() >= V1,NESR.GR:MajorEuro, 0QR4:LSE)

unfortunately it does not work, has anybody an idea?

Hi Max,

It’s not possible to use the IF statement this way using data from two different symbols. One option would be to create a combined dataset in Excel and save as a .csv file and import it in to Optuma to create a chart.

Copy chart data to Excel: https://help.optuma.com/kb/faq.php?id=611

For details on importing .csv data click here: https://help.optuma.com/kb/faq.php?id=672

Example here: https://forum.optuma.com/topic/importing-alternative-data-from-a-csv-file-eg-google-trends/