I thought I would show my modifications, but no luck so far. The trades close as soon as they open.
if (DB_Profit>=DB_Target)DBFloor=DB_Target; if (DB_Profit>=DB_Target)DB_Target=DB_Target*DB_Target_Factor; else if (DBFloor!=0 && DB_Profit<DBFloor); j=OrdersTotal()-1; for (i=j;i>=0;i--) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); RefreshRates(); if(OrderMagicNumber()==DB_Magic && OrderSymbol()==Symbol()) OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,Blue);
if (Bolli_Profit>=Bolli_Target){BolliFloor=Bolli_Target && Bolli_Target==Bolli_Target*Bolli_Target_Factor;} if (BolliFloor!=0 && Bolli_Profit<BolliFloor) {j=OrdersTotal()-1; for (i=j;i>=0;i--) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); RefreshRates(); if(OrderMagicNumber()==Bolli_Magic && OrderSymbol()==Symbol()) OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,Blue);} }
I have been able to have it keep the orders open but I cannot get the DBFloor to receive a value, so they just stay open.
Let me know if you have any ideas.
I'm thinking that the target needs to increment (using "for"??) I'm not sure how to start that.
if(Bolli_Profit>=Bolli_Target && Bolli_Profit-BolliFloor>Bolli_Target ) BolliFloor=Bolli_Profit-Bolli_Target; if(BolliFloor!=0 && Bolli_Profit<BolliFloor) { //Code to close orders }Not totally sure, but I think you need something like this
GumRai thanks again for you help. That helped to lead me in the right direction.
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
{ if (DB_Profit>=DB_Target);DBFloor=DB_Target;DB_Target=DB_Target*DB_Target_Factor; if (DB_Profit>=DB_Target); else if (DB_Profit<DBFloor); } j=OrdersTotal()-1; for (i=j;i>=0;i--) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); RefreshRates(); if(OrderMagicNumber()==DB_Magic && OrderSymbol()==Symbol()) OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,Blue); }