Pages:
Actions
  • #1 by whitey86 on 05 Jun 2013
  • Hi guys,

    Please could you help me with a problem?

    I would like a variable set for each selection call it "num" for example and whenever last_traded is higher than the previous last_traded add 1 to num. If the last_traded is lower than the previous last_traded minus 1 from num.

    Thanks,

    Whitey
  • #2 by mcbee on 05 Jun 2013
  • hi
    you need to add 2 triggers
    Add trigger with 2 variable actions (not conditions)
    action
    set user variable
    name   num1
    value   0
    Add action
    set user variable
    name   lt1
    value   0
    no conditions
    set trigger to favourite
    set trigger to   one time only
    Add trigger with 2 variable actions (not conditions)
    so Add trigger
    action
    set user variable
    name  num1
    value  IF(s_1_last_traded>lt1,num1+1,IF(s_1_last_traded<lt1,num1-1,num1))
    Add action
    set user variable
    name  lt1
    value  s_1_last_traded
    no conditions
    set trigger to favourite
    set trigger to no more than .30

    the num1 and lt1 starts at 0 each new market
    then the num1 is updated if the last traded is more or less than the last recorded last traded.
    lt1 then records the new last traded value for the first selection,index 1
    the s_1_ = index 1
    so you need to do this for all the selections that you want to record the last traded price.
    all you do is add a new action to each of the 2 triggers
    num1 = first favourite
    num2 = second favourite
    and so on
    lt1 = first favourite
    lt2 = second favourite
    and so on
    remember to alter each s_1_last_traded
    so for the second favourite it is  s_2_last_traded
    and so on

    if you need more help, then say the maximum selections that you want to record the prices for.

    mcbee
  • #3 by whitey86 on 05 Jun 2013
  • Hi mcbee,

    Thank you for your reply.

    What if I wanted to monitor all sections is there another way or do I have to create 2 new triggers for up to say 15 selections?

    Thanks,

    Whitey
  • #4 by mcbee on 05 Jun 2013
  • hi
    2 triggers each containing 30 variables (15 num and 15 lt)
    you can use the remember.
    but it is easier to use variables if you want to see the recorded results in the variable screen for each selection index


    mcbee
Pages:
Actions