Transforming a TOS indicator for PRT

Forums ProRealTime English forum ProBuilder support Transforming a TOS indicator for PRT

Viewing 2 posts - 1 through 2 (of 2 total)
  • #226572
    Hello,
    I would like to change this program in TOS language into a ProBuilder language.
    As you can see in the picture attached, the code is drawing support & resistance for several stocks.
    Thank you for your help.
    TOS code:

    def aggregationPeriod = AggregationPeriod.DAY;def LastPrice = close(priceType = PriceType.LAST);

    plot z1_a;plot z1_b;plot z2_a;plot z2_b;plot z3_a;plot z3_b;plot z4_a;plot z4_b;plot z5_a;plot z5_b;

    if (GetSymbol() == “AAPL”) {z1_a = 187.15;z1_b = 186.26;z2_a = 181.91;z2_b = 181.9101;z3_a = 182.115;z3_b = 181.12;z4_a = 184.855;z4_b = 185.525;z5_a = 192.505;z5_b = 192.52;} else if (GetSymbol() == “SPY”) {z1_a = 472.6;z1_b = 472.63;z2_a = 475.39;z2_b = 474.9;z3_a = 471;z3_b = 472.6;z4_a = 475.31;z4_b = 475.35;z5_a = 469.735;z5_b = 467.97;}else if (GetSymbol() == “TSLA”) {z1_a = 220.08;z1_b = 223.7469;z2_a = 230.57;z2_b = 229.47;z3_a = 244.98;z3_b = 240.6701;z4_a = 258.35;z4_b = 262.26;z5_a = 214.86;z5_b = 214.1915;}else if (GetSymbol() == “NVDA”) {z1_a = 495.12;z1_b = 508.7201;z2_a = 524.01;z2_b = 518.8;z3_a = 508.7624;z3_b = 510.72;z4_a = 536.16;z4_b = 536.0911;z5_a = 549.99;z5_b = 547.74;}else {z1_a = Double.NaN;z1_b = Double.NaN;z2_a = Double.NaN;z2_b = Double.NaN;z3_a = Double.NaN;z3_b = Double.NaN;z4_a = Double.NaN;z4_b = Double.NaN;z5_a = Double.NaN;z5_b = Double.NaN;};

    z1_a.SetDefaultColor(CreateColor(40,80,250));z1_b.SetDefaultColor(CreateColor(40,80,250));z2_a.SetDefaultColor(CreateColor(116,189,231));z2_b.SetDefaultColor(CreateColor(116,189,231));z3_a.SetDefaultColor(CreateColor(170,170,170));z3_b.SetDefaultColor(CreateColor(170,170,170));z4_a.SetDefaultColor(CreateColor(140,140,140));z4_b.SetDefaultColor(CreateColor(140,140,140));z5_a.SetDefaultColor(CreateColor(110,110,110));z5_b.SetDefaultColor(CreateColor(110,110,110));

    z1_a.SetLineWeight(5);z1_b.SetLineWeight(5);z2_a.SetLineWeight(4);z2_b.SetLineWeight(4);z3_a.SetLineWeight(3);z3_b.SetLineWeight(3);z4_a.SetLineWeight(2);z4_b.SetLineWeight(2);z5_a.SetLineWeight(1);z5_b.SetLineWeight(1);

    AddCloud(z1_a, z1_b, createColor(80,160,250), createColor(80,160,250), showBorder = yes);AddCloud(z2_a, z2_b, createColor(116,189,231), createColor(116,189,231), showBorder = yes);AddCloud(z3_a, z3_b, createColor(160,160,160), createColor(160,160,160), showBorder = yes);AddCloud(z4_a, z4_b, createColor(140,140,140), createColor(140,140,140), showBorder = yes);AddCloud(z5_a, z5_b, createColor(120,120,120), createColor(120,120,120), showBorder = yes);

    #232232

    Hola. Sería algo así:

    Ten en cuenta que el ticker lo tendrás que seleccionar tú manualmente.

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login