Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: I am triying to make a chart and indicator with this code but something is wrong

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question I am triying to make a chart and indicator with this code but something is wrong

    This is the code of the amibroker charting software and now i have half done with this code to convert to java script but some thing is wrong with this can any one help with this code complete.



    no=Param( "d", 10, 1, 100 );
    \\number = parameter ( ''name'', defaultval, min, max,);



    res = HHV(H,no);
    \\res = high highest value (array,period)


    sup = LLV(L,no);
    \\sup = Low Lowest Value (array,Period)

    avd = IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1…
    \\IIf( EXPRESSION, TRUE_PART, FALSE_PART )


    avn = ValueWhen(avd!=0,avd,1);
    \\valuewhen(EXPRESSION, ARRAY, n = 1)

    tsl = IIf(avn==1,sup,res);
    \\IIf( EXPRESSION, TRUE_PART, FALSE_PART )


    Plot(tsl, _DEFAULT_NAME(), colorRed, styleStaircase);
    \\Plot( array, name, color/barcolor, style = styleLine, minvalue = {empty}, maxvalue = {empty}, XShift = 0, Zorder = 0 )

    Plot( 2, "Ribbon",IIf(C>tsl,colorBlue,colorRed),s… -0.5, 100 );
    \\Plot( array, name, color/barcolor, style = styleLine, minvalue = {empty}, maxvalue = {empty}, XShift = 0, Zorder = 0 )

    Buy=Cross(C,Ref(res,-1));
    \\Cross( ARRAY1, ARRAY2 )
    Sell=Cross(Ref(sup,-1),C);
    \\Cross( ARRAY1, ARRAY2 )

    shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
    PlotShapes(shape,colorRed,0,IIf(Buy,Lo…
    \\PlotShapes( shape, color, layer = 0, yposition = graph0, offset = -12 );

    Buy=Cross(C,tsl);
    Sell=Cross(tsl,C);


    This was i tried what was wrong in this


    var n = Param(1);
    var m = Param(2);
    var HHV = Max(High(),n);
    var LLV = Min(Low(),m);
    var close = Close();
    var HHV-LLV = CreateArray(close.length);
    for(var i=0; iAddGraph(HHV,LLV);
    if(HHV AddBuySignal(i);
    else
    if(LLV>Close())
    AddSellSignal(i);


    this was i tried and i dont know what i am missing in it, can anyone tell me where i am missing it.


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: I am triying to make a chart and indicator with this code but something is wrong

    Just to confirm, this is JavaScript?
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: I am triying to make a chart and indicator with this code but something is wrong

    Quote Originally Posted by JavaPF View Post
    Just to confirm, this is JavaScript?

    var n = Param(1);
    var m = Param(2);
    var HHV = Max(High(),n);
    var LLV = Min(Low(),m);
    var close = Close();
    var HHV-LLV = CreateArray(close.length);
    for(var i=0; iAddGraph(HHV,LLV);
    if(HHV AddBuySignal(i);
    else
    if(LLV>Close())
    AddSellSignal(i);

    This is javascript code and i dont know verywell about java but i know something, can any one help me to complete this code

Similar Threads

  1. need help to make my code flexible.
    By sagar474 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 29th, 2011, 12:11 PM
  2. scatterplot chart
    By anikal in forum AWT / Java Swing
    Replies: 2
    Last Post: August 23rd, 2011, 11:47 PM
  3. Make my code follow MVC
    By alpvii in forum What's Wrong With My Code?
    Replies: 6
    Last Post: November 29th, 2010, 07:48 AM
  4. Add MS Office communicator presence indicator into JSP.
    By priteshg23 in forum Java Native Interface
    Replies: 0
    Last Post: November 9th, 2010, 02:53 AM
  5. gui to make a flow chart.
    By Abhinav in forum AWT / Java Swing
    Replies: 1
    Last Post: January 27th, 2010, 02:04 AM