Example:
Losser operation dax un 9125.
I need, the system dont operate before in range 9100-9150 automatically.
Below will NOT open trades between 09:10 and 09:15.
Not Tested
ctime = Time > 091000 and Time < 091500
If BuyCondition and NOT cTime Then
Buy at Market
Endif
Otherwise if i well understood that he doesn’t need to operate before 9.10 and after 9.15.. not so clear english
defparam flatbefore= 091000
defparam flatafter= 091500
Please, price range… No time.
And system learn automatically… No write bad operation in Code.
@Fran55 it be easier if you use the google translator as we find it difficult to understand what you want help with?
¿será más fácil si utiliza el traductor de Google, ya que nos resulta difícil entender con qué quiere ayuda?
https://translate.google.com/
Yes please Fran55, try to use translator and then copy paste the translated text here, that would help us a lot!
Okay.
The robot has opened position at dax at 9150, and the position has been losing.
I want it to no longer open position between 9125 and 9175 from now on.
But without touching the code again … you have to program in advance that when you lose in a position, you will not enter the market in that price range again.
Thank you.
I can’t see where this is going as to avoid a Price level that loses is not logical as next time the same Price level could be the entry to the biggest winning trade for days??
But to move this on … is below what you need?
Not Tested
If onmarket and Positionperf < 0 Then
LossTrade = TradePrice
Endif
If CondBuy and NOT LossTrade Then //CondSellShort
Buy at Market // SellShort
Endif
With v11 you could use arrays to store all price levels where a loss has been suffered, but whenever the TS is stopped, all those data are lost!
It’s not a price level that will make you win or lose, it’s the logic on which the TS is built and…. the fact that losses are an essential part of trading!
It’s like happiness and sadness, no one can be without the other.
Try to make happiness prevail, though! 🙂
No me vale.
?? … above doesn’t make sense again??
Grahal.
Range of price, please.
Up and down 0.5% of price entry in the loss position.
Something like this should store the last three losing exit prices and not open a new trade if price is +/-0.5% of them. Not tested.
if strategyprofit < strategyprofit[1] then
price3 = price2
price2 = price1
price1 = tradeprice
endif
tradeon = 1
if close < price1*1.005 and close > price1*0.995 or close < price2*1.005 and close > price2*0.995 or close < price3*1.005 and close > price3*0.995 then
tradeon = 0
endif
if (your entry conditions) and tradeon then
buy 1 contract at market
endif