Trabalho concluído
Termos de Referência
I need to modify OP with the same takeprofit; set for breakeven no matter if buys, sell or both.
The takeprofit must follow a trend indicator as to which side it must be placed.
example: trend is sell so TP is set below price, and above price if trend is buy.
:Let me further explain:
When my strategy fails to exit within a few bars there can be adding of orders.
There can be same OP type, and there can even be mixed OP type, and the takeprofit should be set to a price that means it is breakeven(optional) following a trend for which side of price to put the take profit.
I have a working EA with all the steps needed for entering the TP trailing methods
Incase price surpasses the TP before setting it orders must be closed clientside.
This is where I need work on
void ManageTP() { //initial TP after two bars for cumulative profit if( OrderBarsOpen==1 && LastOpenBar==2 ) { //if TP to be set is surpassed by open price then close all trades //set TP for all orders to breakeven & 1 point profit } //cumulative profit exits if( OrderBarsOpen>1 && LastOpenBar>2 ) { //trail takeprofit by trend, sell=below price & buy=above price switch(iST(0)) { case 2: //sell trend //if TP to be set is surpassed by open price then close all trades //set TP for all orders to breakeven & 1 point profit below price break; case 1: //buy trend //if TP to be set is surpassed by open price then close all trades //set TP for all orders to breakeven & 1 point profit above price break; default: break; } } TrailedThisBar=true; }