condition ” if last order closed was long/short”
5 years ago #114981
I’m still trying to find out how I can include in my ea strategy the condition that if the last CLOSED order was, for example long ( it could have closed several bars ago) and then RSI crosses above 50 say then to reenter the market in the same direction ie long. If, on the other hand RSI crossed below 50 I do not want the ea entering short unless the previously closed trade was also short. I understand that the strategy control function “if LAST ORDER was long/ short” only refers to the last currently open trade and not to the last now closed trade??
Thanks in advance
Hello, to me your strategy sounds odd since you enter long on RSI cross above 50 (while previous trade was long) but how do you enter short after that? If RSI crosses below 50 you will never go short since the last trade was long and you always go in the same direction. I see no logic on how to “switch” from long to short. Am I missing something? Thanks
5 years ago #136344
Actually my strategy basically enters trades on Fisher Transform crosses out of oversold ( I use +1 and -1 levels for this). Ideally the trade runs all the way to opposite oversold before reversing and I only want to trade in the original direction until reverse signal appears. But to protect against losses I want the ea in the case of a long to close the trade in the event that Fisher Transform crosses back below the midline. This is simple enough but then I want the ea to reenter long if Fisher then crosses above the zero line and also I have a rule for reentry using RSI 5 crosses above 50 because this is usually a lot quicker. I have similar rules for short entry. The problem was when for example I closed a long trade because Transform crossed back below 0.0 then my short entry rule to enter on cross below 0.0 kicked in and I only wanted long trades at that point according to my strategy. But I think I have solved that by adding to my rule for entry on cross over or under 0.0 the condition that bars since last order closed (magiclong or magicshort) must be => 1. I think this effectively prevents entry in a direction I don’t want.
Sorry if I have confused you… its confusing for me too. You’re right, basically what I want is long or short only trading after main signal of Fisher Transform crosses out of oversold ie +1 or -1 level. Is there a way to add this command (long or short only) to the order and have that remain until reverse oversold signal appears? Its not practical to always change it manually using the ea common tab.
Thanks for your help.
Viewing 3 posts - 1 through 3 (of 3 total)