Blood in semen it started one for a couple of days last year then stopped. Is it a result of masterbation

It can be, also sex. if very vigorous or if stopped just before the point of ejaculation. Alternatively, going long periods can also potentially cause problems. Infection in prostate or bladder or after instrumentation can also cause blood.
Blood . Blood in semen could occur as a result of trauma or a medical condition. Semen and fluids are ejaculated from the prostate, then go through a series of tubes in the genitalia and join at the urethra for execution from the penis. Throughout the genitilia, there are many areas and blood vessels that could be broken, leading to blood in the urine or semen. Items that could cause trauma and blood in the semen could be aggressive sex or masterbation, interrupted sex, kidney stones, prostatitis or a procedural biopsy on the testicles/kidney/bladder. Medical conditions that can cause blood in the semen include: side effects of blood thinners, stds such as chlamydia/genital herpes/warts, prostate cancer or bladder cancer. Blood in semen is rarely indicative of a serious medical condition. See your doctor if you experience ongoing blood in the semen or urine.