take profit with red or green candle

 
As written in the title I try some ideas, to write an EA that gives me the take profit with a red or green candle without taking into cosider the pips.
For example PUT signal: sent over the order with my condition and if the candle closes RED are GAIN, and I reached the Take Profit, otherwise I continue with another candle....
Then use a martingale!

Ideas regarding my example?
 
  1. You have only three choices: Search for it, learn to code it, or pay (Freelance) someone. We're not going to code it FOR you.
    We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
  2. You've posted no example, just a vague idea (no SL, no risk, no direction, just an exit idea.)
  3. Martingale: a sure way of eventually blowing your entire account.