You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Move lines for SL, TP and Pending B or S
I need an indicator where I could drag and drop horizontal lines for SL, TP and Pending Orders.
Please check attached jpeg
Moving lines for SL, TP and pending orders
Image failed to upload on the start of thread. here it is
...
Easy.ea in one of my posts...BS for buy...SS for sell
Image failed to upload on the start of thread. here it is
Something close on this thread. Look for kimiv EA.
Percent Trailing (Trailing stop)
Hi everyone,
I am busy working on a simple exit strategy, using a percent trailing. I have previously been working with Tradestation, but then discovered Metatrader and am currently developing an EA.
Tradestation has a function SetPercentTrailing where I can pass 2 values a floor amount and a percent trailing. I am trying to reconstruct this function in EA.
So far I have put together this code:
// Trailing stop calculation
if(OrdersTotal() > 0)
{
OrderSelect(ticket, SELECT_BY_TICKET);
CurrentProfit = OrderProfit();
if (CurrentProfit >= HighestProfit)
{
HighestProfit = CurrentProfit;
}
if (HighestProfit >= (FloorAmt*Lots))
{
if ((HighestProfit - CurrentProfit) / HighestProfit) * 100 >= TrailingPct)
{
if(OrderType() == OP_BUY)
{
OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Red);
HighestProfit = 0;
}
if(OrderType() == OP_SELL)
{
OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Red);
HighestProfit = 0;
}
//Print("Closing order for Trailing amount");
} }
}How it works, is that if I am in a trade, it continuasly sets a highest profit. Now if my current profit is higher then a floor amount that I set, and my profit drops below a certain percentage of my highest profit, then I close my trade.
Logically I think that this is correct, but unfortunately it does not give me the same results as in Tradestation, and I am wondering if there is an error in my code, or if Tradestation's Trailing Percent works differently.
Any help appreciated...thanks
script horizontal line for S/L and T/P
I want to use horizontal line to manually move up or down for my S/L and T/P for my open trades.
Can anyone give me that script please. I don't want EA automatic Trailing Stoplosss and T/P. It 's better for me to adjust horizontal line
accordingly with price action.
Thanks for your help. I am very much appreciated