Hi everyone,
I have an idea for an EA and was hoping somebody could help me program it in mql4 (i'm just beginning to learn at the moment). I don't think it would be that hard for a decent programmer. I'll do my best to explain the rules of the EA:
1) The EA only ever trades long
2) If bar[2] (second to last candle) is Red, AND bar[1] (last candle) is Green, AND price on current candle is above High[1] (highest price on last green candle) then go long. This would mean as soon as the price on the current candle breaks the last candles high then a buy order would be placed.
3) Set a StopLoss of 8 straight away. Ideally a trailing stop would be best set at -3 once break even has been hit. If the trailing stop could be implemented then there would be no need for TakeProfit level. If not then take profit set at +5.
4)Only one trade per candle - no more.
5) I have in mind trying it on the 15M chart but it could work on any chart - just changing the SL and TP to higher with higher TF's.
The idea behind this is to scalp reversals. That is why bar[2] has to be red, bar[1] green , and current bar rising. As its only one trade per candle even if the next bar continued rising above the high then no trade would be activated because bar [2] would then be green and not red!
Really sorry for the long-winded explanation.
I started to code a bit just to determine the candle colours-
int a=0
double candlecol2= (Close[2]-Open[2]);
double candlecol1= (Close[1]-Open[1]);
so then I wanted to have something like:
if ((candlecol2<0)&&(candlecol1>0)&&(currentprice>High[1]))
BUY!!! (with the SL and TP set).
I know this isn't correct coding but hopefully you can see the logic behind it - thats why I need help. Looking to learn from you guys.
Many Thanks for your help.
Jimmy Noodles
I have an idea for an EA and was hoping somebody could help me program it in mql4 (i'm just beginning to learn at the moment). I don't think it would be that hard for a decent programmer. I'll do my best to explain the rules of the EA:
1) The EA only ever trades long
2) If bar[2] (second to last candle) is Red, AND bar[1] (last candle) is Green, AND price on current candle is above High[1] (highest price on last green candle) then go long. This would mean as soon as the price on the current candle breaks the last candles high then a buy order would be placed.
3) Set a StopLoss of 8 straight away. Ideally a trailing stop would be best set at -3 once break even has been hit. If the trailing stop could be implemented then there would be no need for TakeProfit level. If not then take profit set at +5.
4)Only one trade per candle - no more.
5) I have in mind trying it on the 15M chart but it could work on any chart - just changing the SL and TP to higher with higher TF's.
The idea behind this is to scalp reversals. That is why bar[2] has to be red, bar[1] green , and current bar rising. As its only one trade per candle even if the next bar continued rising above the high then no trade would be activated because bar [2] would then be green and not red!
Really sorry for the long-winded explanation.
I started to code a bit just to determine the candle colours-
int a=0
double candlecol2= (Close[2]-Open[2]);
double candlecol1= (Close[1]-Open[1]);
so then I wanted to have something like:
if ((candlecol2<0)&&(candlecol1>0)&&(currentprice>High[1]))
BUY!!! (with the SL and TP set).
I know this isn't correct coding but hopefully you can see the logic behind it - thats why I need help. Looking to learn from you guys.
Many Thanks for your help.
Jimmy Noodles
The best trade I ever made was my SIN for Jesus' RIGHTEOUSNESS.