Login Page - Create Account

Support Board


Date/Time: Mon, 24 Feb 2025 18:13:25 +0000



Post From: plotting a condition on chart

[2021-03-15 20:13:38]
User61576 - Posts: 445
I am trying to call another study and to plot on the chart a simple condition using this code


SCFloatArray P_R_Upper_Band; //Upper Band
  sc.GetStudyArrayUsingID(Input_LIne1_Poly_Reg.GetStudyID(), Input_LIne1_Poly_Reg.GetSubgraphIndex(), P_R_Upper_Band);

  SCFloatArray P_R_Lower_Band;//Lower Band
  sc.GetStudyArrayUsingID(Input_LIne2_Poly_Reg.GetStudyID(), Input_LIne2_Poly_Reg.GetSubgraphIndex(), P_R_Lower_Band);
  
  float PRUB = P_R_Upper_Band[sc.Index];
  float PRLB = P_R_Lower_Band[sc.Index];

  if (
    // make sure the price is < = lower band
    sc.Low[sc.Index] <= P_R_Lower_Band
    )
  {
    // mark the signal on the chart
    Subgraph_P_R_BuyEntry[sc.Index] = sc.Low[sc.Index];

  }

when compiling I am getting this error:

error: no match for 'operator<=' (operand types are 'float' and 'SCFloatArray' {aka 'c_ArrayWrapper<float>'})

any advice here on how to solve this?
thanks