SetStopLoss("target1",CalculationMode.Price,Close[0] - (stop/10000d), false);
SetProfitTarget("target1",CalculationMode.Price,Cl ose[0] + ((target/10000d)-0.00001));
EnterLongLimit(Close[0], "target1");
}
private void GoShort(){
SetStopLoss("target1",CalculationMode.Price,Close[0] + (stop/10000d), false);
SetProfitTarget("target1",CalculationMode.Price,Cl ose[0] - ((target/10000d)-0.00001));
EnterShortLimit(Close[0], "target1");
}
private void ManagedOrders(){
if(Position.MarketPosition == MarketPosition.Long)
{
if (...)
SetStopLoss("target1",CalculationMode.Price, Close[10],false);
}
if(Position.MarketPosition == MarketPosition.Short)
{
if (...)
SetStopLoss("target1",CalculationMode.Price, Close[10],false);
}
}
Firstly: I am currently using stop/10000d so my stop parameter as a real number gets calculated down to eurusd pips. but ofc this doesnt work for jpy pairs, thats why i have to change it when im testing those. is there a workaround for it, so it always knows the correct pip amount
Secondly(and more importantly) regarding multiple positions: with this setup i am ofc not able to generate unique entries, i either have to wait for 1 trade to finish, or it will scale up my target and stoploss everytime im gettin a new entrysignal for all existing positions.
an easy workaround would be to just use "target1"+currentbar for target and stoploss as well as for the entry. since they are all calucalted on the same bar, the tag would fit.
the problem that arises is now that my order management is ofc not calculated on that same bar, so im assuming that "target1"+currentbar wouldnt do anything here, bc the tag would be wrong, and therefore the stop would never be trimmed for the right position.
any idea how to work around that? how to do it so that managed oders() will know for what position to adjust the stop and will do it only for that then.
thanks
Comment