Total profit reduces by x % then close everything.
-
So think that exclude the new position is a must in this one , but i have loaded 3 different eas on 3 different brokers right now to see how they act , the other test with the closing were almost only drawdown and the profit closed at 2-5 $almost every time

So i set up one with the 30 min closing , one with a larger pip value before it starts , and one using the equity instead of profit just to see

-
All right

There is certainly a way to make the ea as you said, excluding the losses from new positions. But I'm afraid it won't be very simple or elegant solution.You would need a variable for the modified profit.
Then find out how much loss a new trade causes, this could be done with some more variables, one variable should show the profit a few candles ago, so when a trade happens, the loss could be calculated. The loss would then be subtracted from the "modified profit" variable.
Then there should be another variable that keeps track of the losses caused by opening trades, a "loss bank" variable. That "loss bank" could then be slowly drained to the "modified profit", so the losses would be taken into account after some time, and "modified profit" would get closer to the real profit.Anyway, thats how I would do it, but I'm not sure if its worth the trouble

-
@roar
That sounded alot
Can't I be made with flags ? Like if a trade is created set the value to false and that it checks if the flag are true before it takes action .
Or something if trade created don't do anything and if it's not true it goes through a turn on block that turns on the section of our profit close, and if it closes it closes the profit section to

-
-
Hmm, yeah, could work

If you just want to delay the ea after something happens, this is what I usually do:
- create variable barcount
- on each bar, modify variable barcount to barcount +1 , so the variable just increases every bar
then, if you want to wait 3 bars after opening a trade: - reset the barcount at buy or sell,
- put a condition: barcount > 3
-
That is really helpful and will keep that in mind !

The example i sent to you was on the eqity part because that was the last ea i changed before i added everything on my 3 brokers and it seems to do something in what i want
Sorry for the amount of entries i have the strategy to powerd by no trade nearby haha
but anyway 

-
Hehe, 19000 trades - the spread costs could be pain in the ass in live trading

-
19 000 trades in 1 year on 1 chart haha , think how valued you would be at your broker haha .. they will earn as much money as you do constantly

But the thing is that it charges profit spikes, and that i wanted to see

-
Yeah, the core principle seems to be working, now its just about improving the ea as whole

-
@roar
Hello again !
I have a new question as well,
I have also tried to do one more thing , if the market reverses x pips close all the positions of that type.
So if in buy , it my strategy will buy along the candle but if it goes down like 10 pips I want it to close all buy trades from that ea.
So no total profit this time
I have tried for each buy and sell, - 10 pips from open price then close but it does not seem to do it

Then in my mind it can be fitted with a pip value that the chart has to reach before it takes action .
Hope you can help!
-
Hi

Check my build:
https://fxdreema.com/shared/Ij9U5P7gc -
You have to set the reverse as price fraction, though. Can be fixed

-
Thank you so much ! will try it out and see how it behaves !

-
Tried it in backtester , it seems like it closes the orders instantly , so i tried to change the value of ReverseFraction to 10 instead , and then it seems like it does the work right

-
Oh, okay, thats strage

The formula block is now putting "10" to a price, for example 1.16590 + 10 = 11.16590
Reeally strangeI didn't test it myself
-
hmm and that is too much , but i dont know why it showed a more normal result on backtesting

But i tried something , using lines .https://fxdreema.com/shared/5WaVD65ze
Its from block 20 to 37 and 80 to 90 .
It makes two lines , that move along price when its pushed by price

-
Thats quite insightful solution

And should even work! -
I got my example working too, had to reset the high/low variable (to 0) at closing block.
Btw, this principle is not far from just using Trailing stop

-
I will try the reset that you wrote and see what it does

Haha i noticed that too , but it might work better , less orders adjustments through the broker

-
can you upload the one that was working ? mine still does the same thing
