Unable to see WriteIF correctly

Unable to see the Remarks even though the condition is met.
Expectation: Should see "RS Crossover"
Current behavior: Blank

image_2023-10-04_125104654

_SECTION_BEGIN("RS Crossover");

CompIndex = Foreign( "^NSEI", "C" ); // Comparing other indices
RS = Close / CompIndex;
RSMavg21 = MA(RS, 21);
RSMavg5 = MA(RS, 5);

RSCross = Cross(RS,RSMavg21); 

RSCon = IIf( RSCross, True, False );
Remarks = WriteIf( RSCon, "RS Crossover","");

_SECTION_END();


Filter = RSCon;

AddtextColumn( Remarks, "Setup Condition", 1);
1 Like

I am trying to identify the point in red circle.

On debugging i am seeing only null values for RSCross

  1. In the Watch window, use "ARRAYS" tab - it shows values of entire arrays.
  2. WriteIf() uses Selected Value as explained in the manual
    https://www.amibroker.com/f?writeif

Quote from manual:
Please note that WriteIf returns just single string representing current SelectedValue of the EXPRESSION

In Analysis SelectedValue is LAST bar of analysis period ("Range").
In Chart, SelectedValue it is the date that is selected by the user by vertical line (click).

https://www.amibroker.com/f?selectedvalue

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.