Heart palpitations can have a number of causes but since you mentioned they are worse when stressed - then they are probably related to anxiety and excerbated by blood sugar swinging up and down. Adrenal herbal adatagens (only take them if you are not on medication) especially schizandra can help both the nervous system and stabilize blood sugar. Removing stimulants like caffeine and nicotine, as they put stress on the adrenals making us more anxious, can help as well. Alcohol and a refined food diet can also cause blood sugar swings. And just being stressed causes you to burn sugar and not fat and starts the process of the blood sugar swinging up and down. Consuming a whole diet with lots of fibre and a steady source of fibre-filled carbs spread evenly through out the day in small meals is also helpful. Pay attention to what you have recently consumed before the heart palpitations start, to get clues for what is making them worse.
GABA is a great supplement for anxiety. 5HTP has helped some people. Lack of magneisum and too much calcium can also cause heart palitations and so can too much sodium and not enough potassium. Dairy products contain a lot of calcium and therefore magnesium rich-foods like nut and seed or a magneiusm supplements needs to be consumed to balance out the calcium levels - again a well-balanced whole food diet will take care of this. Fast foods and refiend foods contain too much sodium and not enough potassium so again, who food diet balances this and potassium supplements are available as well.
Also learn stress management techniques and deep breathing alone can calm the nervous system. It make take a few tries to find the right combination of things for you but well worth the effort. Good luck.
Response by Lorene Sauro B.A., R.H.N