• Australian (ASX) Stock Market Forum

Hello and welcome to Aussie Stock Forums!

To gain full access you must register. Registration is free and takes only a few seconds to complete.

Already a member? Log in here.

Text Selector

Discussion in 'Trading Strategies/Systems' started by Steve C144, Aug 12, 2019.

  1. Steve C144

    Steve C144

    Posts:
    19
    Likes Received:
    0
    Joined:
    Jun 17, 2019
    Hello all,
    See my Text Selector statement below. Does Amibroker support using more than one array in text selector? See I have used MET and today1 arrays...getting odd results...should I be able to do this or is there another way? Note the values for MET and today1 overlap in the array data...i.e. -.2 occurs in both arrays.

    TextSelector = 1 * ( MET < -.20 ) + 2 * ( today1 >-.2 AND today1 < 0 ) + 3 * (today1 > 0 AND today1 <.5) + 4 * (today1 > .5 AND today1 < 1 ) + 5 * (today1>1);

    TIA.
     
  2. Trav.

    Trav.

    Posts:
    340
    Likes Received:
    296
    Joined:
    Nov 27, 2017
    @Steve C144 firstly think about posting your questions in the following thread instead of creating a new thread

    https://www.aussiestockforums.com/threads/amibroker-faq.1679/

    You are giving us less code to work with but I use the following line in my code and you should be able to adapt it to suit so the result is either 0, 1, 2, 3, 4 ,5, 6 etc as it appears you are multiplying the result of an equation and this could be giving you odd results

    TextSelector = IIf(C1B OR C1S, 1, IIf(C2B OR C2S, 2, IIf(C3B OR C3S, 3, IIf(C4B OR C4S, 4, IIf(BTSell, 5, IIf(C5B OR C5S, 6, 0))))));
     
Loading...

Share This Page