SP how can I sum the amount of all leftchild in parentid
Assuming the following:

alter table mytree add constraint ck1tree unique (memberid);
alter table mytree add constraint ck2tree unique (parentid,position);


One suggestion is to start with a procedure that calculates the sum of the subtree (regardless of position):

There is probably more elegant solutions to this, but I'm in a bit of a hurry and I think it will get you started so I'll post anyhow. Note that you will probably have to adjust the variable @@max_sp_recursion_depth;

set @@max_sp_recursion_depth = 10;
delimiter $$
CREATE DEFINER=`root`@`localhost` PROCEDURE sum_subtree
    (IN `p_memid` INT, OUT `tot_left_amount` DECIMAL(10,2)  
)
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
    DECLARE tmp decimal(10,2) default 0;
    DECLARE tmp2 decimal(10,2) default 0;
    DECLARE a decimal(10,2);
    DECLARE mid int;
    DECLARE finished int default 0;

    DECLARE c1 CURSOR FOR
        select memberid, amount
        from mytree where parentid = p_memid;

    DECLARE CONTINUE HANDLER
        FOR NOT FOUND SET finished = 1;

    OPEN c1;
    get_amount: LOOP
        FETCH c1 into mid, a;
        IF finished = 1 THEN
            LEAVE get_amount;
        END IF;

        -- recursive call to procedure 
        CALL sum_subtree(mid, tmp);
        SET tmp2 = tmp2 + tmp + a;
    END LOOP;
    SET tot_left_amount = tmp2;
END $$
delimiter ;


call sum_subtree(7,@x);
select @x;
+----------+
| @x       |
+----------+
| 18000.00 |
+----------+


Now you can create a procedure that select the value from the 'L' branch, call this procedure and return the sum of those two values. Hope it helps

Edit: example of calling procedure:

delimiter $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `count_left_right_amount`(
    IN `p_memid` INT, OUT `tot_left_amount` DECIMAL(10,2)
)
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
BEGIN
    DECLARE a decimal(10,2);
    DECLARE m int;
    DECLARE s decimal(10,2);

    select memberid, amount into m, a from mytree
    where parentid = p_memid and position = 'L';

    call sum_subtree(m,s);
    set tot_left_amount = a + s;
END $$
delimiter ;


call count_left_right_amount(5,@y);

MariaDB [test]&gt; select @y;
+----------+
| @y       |
+----------+
| 22500.00 |
+----------+
1 row in set (0.00 sec)