Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
if(AccountEquity()<AccountBalance()) { { int ttotal = OrdersTotal(); for(int i=ttotal-1;i>=0;i--) { OrderSelect(i, SELECT_BY_POS); int type = OrderType();
bool result = false;
switch(type) { //Close opened long positions case OP_BUY : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red ); break;
//Close opened short positions case OP_SELL : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );
ok this is what I tried ..it's mostly copied from another code someone else here made...but it's just closing everything as fast as they open and not paying any attention to the 'if' condition before executing closes....oy I'm not good at this....I obviously don't have the part that is doing the closing of orders sufficiently attached to the conditional line that compares the account equity to the account balance. Could someone please help me with this?
upon closer inspection it appears that what I have IS working and behaving exactly like a stop loss.
when I add this to it...
if(AccountEquity()+8<AccountBalance())
it behaves exactly like a stop loss at 8
so at least I've done the code right for once eh? Sadlly it's not producing the effect I wanted in the EA. It's messing with the winners who need the stop loss wider to work too. victory and defeat all at the same time...ok so be it.
I'm still learning code. This is supposed to trigger a trailing stop to engage as a specified level. I can see from some test results that it didn't trigger when it should have.
I'm wondering if this is written correctly as 'Point*TrailingStopTrigger' is it supposed to multiply or simply add the value of the TrailingStopTrigger to Point for sell positions and subtract if for buy positions. Is that why it's not triggering like it's supposed to? Or is there something else?
It doesn't seem to change the results. I may have been mistaken in assuming that it should have triggered.
I have 4 reports attached. The only difference between them is the size of the stop loss. This tells me that alot of retracement is going on. That doesn't mean that I want to allow losers to play out to the full stop loss if I can shut them down based on some additional rule that doesn't disproportionally detract from the winners.
Looking at the results from the 186 stop loss report, and looking back at the charts of these 5 losers at their entries. 4 out of 5 of them the bar immediately after opening the position the next bar closed against the position. I don't know if some sort of rule like that could be added like a stop loss to close positions if the very next bar after the position opens goes against it to close the position would work or not. It would have stopped 4 of 5 losers that remained but I don't know how many of the winners it would have also shut down.
I don't know how that kind of rule would be programmed. I just manually walked thru the first 20 trades and it would have shut down 15 of 20 so that won't help.
Before any one takes up that task, can you explain what the strategies are and give some details, url references for them. If it is an winning strategy, then someone will take up the challenge. Otherwise, why would anyone spend their time translating.
I'm trying to write a piece of code that will modify the TP of allexisting trades. When I attach the code to a chart, it works only for the currency where the expert is attached. It does not modify other trades from other currency pairs. Please note that I'm not checking the OrderSymbol()==Symbol() in my code. Where is the mistake? Do I have to add a "return(0)" after each OrderModify()? Can you help me?
Does the expert allow me to open/close/modify trades of a different currency pair while the expert is attached only to a single chart? I'm trying to write a universal code that will process (ie, either modify or close) all existing trades regardless of the chart where the EA is attached to. Can someone please confirm if this is possible at all? If yes, then what is wrong with the following code?
int mTrades=OrdersTotal();
if (mTrades>0)
{
for (i=0;i<mTrades;i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() == OP_BUY)
{
OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), Ask+100*Point, White);
}
if (OrderType() == OP_SELL)
{
OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), Bid-100*Point, White);
}
}
}