Requirements: - Should work on 4 and 5 digit brokers. - EA that will trade on any pair (attached to the chart) - timeframe available to choose (for now H1 is fine) - will require closing of partial position in profit. - please write the code with clear notes, so it's easy to change if needed. - rather then opening the long position from the condition below please setup up so EA will check 2 buy setups - single signal entry point won't be profitable. I'll add another entry point later on. If both buy setups are true then we can open long position. Analogical situation for short; - mov average (period) applied to close - need to work with backtesting Need to check for the following conditions on the lower time frame: (if EA trades on H1, let's check M30 and find: on every new bar: 1) Long position setup: a) buy_setup_lowertimeframe true if //details later b) Now we are ready to check on current timeframe. buy_setup1: //details later 2) Short position setup: //details later 3) opening positions: position size should be based on the risk - i'm open to suggestions here. buy_setup1 is true and buy_setup2 is true → open long position. (For now you can set buy_setup2 to be true all the time.) sell_setup1 and sell_setup2 is true → open short. (same as above, sell_setup2 = true all time) - only one position at the time. 4) takeprofit ½ position close 1stTP, 1/2 position on 2ndTP, if there is only minimal position open (0.01) then close it on 1st TP 5) SL - moving average of last bar [1] +/- delta_stop_loss; so will change at each new bar - after 1st TP is realized – SL should be position open_price +1pip (for long), open_price -1pip (for short); unless mov value is higher (long) or lower (short) example for short: If mov is higher then position open_price, SL is set at open_price-1pip, when mov goes below position open_price-1pip then we use mov value. Both TP and SL should be track internally (not set when we're opening trade), and position close when price reach this values 6) inputs: - risk (for the position size) - timeframe - mov_period (moving average period) - delta_long_mov (last bar closed price above moving average) - delta_short_mov (last bar closed price below moving average) - delta_last_price (min difference open/close price on the last bar) - delta_stop_loss (difference from moving average) - TP1 (first takeprofit) - TP2 (second..)