Easylanguage code problem

Discussion in 'App Development' started by ponex, Aug 31, 2017.

  1. ponex

    ponex

    Dears traders,

    Example long
    When sma60> sma90 and sma60> sma150 and sma90> sma150 we will take as maximum reference the maximum of the 30 bars before the cross.
    If then this maximum will be broken upwards we will have long signal.

    I have verified that it does not respect the maximum constraint of the 30 candles before the cross up.
    What's wrong with the formula ??

    thank you.
    All help graciously received and appreciated.

    luca


    code:

    Input: average(c), len(60), len1(90),len2(150);

    condition1= len>len1 and len>len2 and len1>len2 ;
    condition2=len<len1 and len<len2 and len1<len2;

    condition3=H crosses over Highest(h,30);
    condition4=L crosses under Lowest(l,30);

    if condition1 and condition3 then buy next bar at market;
    if condition1 and condition4 then sellshort next bar at market;
     
    Last edited: Aug 31, 2017
  2. ponex

    ponex

    in simple terms:

    When the averages cross up, the cross is the condition that if it is true we will have buy signal at the top when it is exceeds the previous 30 candles crossing.
     
  3. O(1)

    O(1)

    i've never used easylanguage and not exactly sure what you are trying to do. but, I'm gonna take a guess:

    if H looks at the high of last bar closed
    and highest looks at a series of highs including the high of last bar closed

    then will H ever be higher than highest? maybe you want to use ask/bid?
     
  4. ponex

    ponex

    hi 0(1)

    the condition: moving averarages cross up I take as reference the max Of the 30 candles before the cross ,that if it is broken up there is the buy signal

    regars
     
  5. O(1)

    O(1)

    Hi. :)

    I'm talking about this line:
    condition3=H crosses over Highest(h,30);

    what are you trying to check?

    on another note
    does your last line mean to say condition2 and condition4?
     
  6. ponex

    ponex

    hi :)

    sorry 0(1)
    the right condition is this:

    condition1= len>len1 and len>len2 and len1>len2 ;
    condition2=len<len1 and len<len2 and len1<len2;

    condition3=H crosses over Highest(h,30);
    condition4=L crosses under Lowest(l,30);

    if condition1 and condition3 then buy next bar at market;
    if condition2 and condition4 then sellshort next bar at market;


    the problem is that H crosses over Highest(h,30) end L crosses under Lowest(l,30)
    are not calculated before the cross.
    I have to define the variables:
    condition1= len>len1 and len>len2 and len1>len2 ;
    condition2=len<len1 and len<len2 and len1<len2;

    :(
     
  7. O(1)

    O(1)

    let's talk about this:
    H crosses over Highest(h,30);

    is that .. previous bar high.. crossing higher than highest in the series?
     
    Last edited: Aug 31, 2017
  8. ponex

    ponex

    Highest(h,30); must be calculated if condition1=true.
     
  9. O(1)

    O(1)

    yes, that's very obvious.
    what is H? I'm assuming it is the high of last bar. .Is it?
     
  10. ponex

    ponex

    yes
    H last bar
     
    #10     Aug 31, 2017