How , when close position with stop loss go to open anther postion

 

How , when close position with stop loss go to open anther position

 

I used this http://www.strategytune.com 

 

what I mean is ,

when close buy  position with TakeProfit don't do nothing 

 when close buy  position with StopLoss open sell position 

 

I hope it is clear

 


 
Schopenhauer:

How , when close position with stop loss go to open anther position

 

I used this http://www.strategytune.com 

 

what I mean is ,

when close buy  position with TakeProfit don't do nothing 

 when close buy  position with StopLoss open sell position 

Loop through the closed orders,  find the last closed,  select it, check it's OrderClosePrice() against it's OrderStopLoss()
 

or if your stoploss is big enough you can do

Place your buytrade with your stopsettings and a OP_SELLSTOP trade

set at stoploss of your buytrade the orderopenprice of your sellstop

when buy closed check if there still is sellstop if so delete it 

 

I don't get it please walk with me , I don't writing code all I know this site


after stop loss i want put sell position .... how I do it  

 

 

with what (orderstatus or magicindex or closeposition or ,,, or ,,,)  I can link it

 

when buy position closed with StopLoos open sell position 

 
Schopenhauer:I don't get it please walk with me , I don't writing code all I know this site

When you registered, perhaps you missed the part about Any discussions except of concerning MetaQuotes Language 4 and auto trading are forbidden. You're off topic for this forum.

If you want to use http://www.strategytune.com fine, go to their website.

If you want to discuss your code, you'll have to post it (using SRC)

 
Schopenhauer:

I don't get it please walk with me , I don't writing code all I know this site


after stop loss i want put sell position .... how I do it  

Go there and ask for help.  This forum is about mql4.
 
RaptorUK:
Go there and ask for help.  This forum is about mql4.


why you are mad , it is OK
 
WHRoeder:

When you registered, perhaps you missed the part about Any discussions except of concerning MetaQuotes Language 4 and auto trading are forbidden. You're off topic for this forum.

If you want to use http://www.strategytune.com fine, go to their website.

If you want to discuss your code, you'll have to post it (using SRC)



perhaps you missed the part about

Gentleman

THANKS  

 
Schopenhauer:

why you are mad , it is OK
Mad ?  why do you think I am Mad ?  if you want help with mql4 then ask here,  if you want help with something other than mql4 then this is not the best place to ask,  isn't that obvious ?
 
#define __STRATEGY_MAGIC 1953164759

//Inputs

//Declaration
double _Bollinger_Bands;
bool _Compare1;
bool _Open_Buy;
bool _AND;
bool _Compare2;
double _Bar_Data;
double _MACD1;
double _MACD2;

int start(){

   //Level 1
   _Bollinger_Bands = iBands(Symbol(),15,20,2,0,0,1,0);
   _Bar_Data = iClose(Symbol(),15,0);
   _MACD1 = iMACD(Symbol(),0,12,26,9,0,1,0);
   _MACD2 = iMACD(Symbol(),0,12,26,9,0,0,0);

   //Level 2
   _Compare1 = _Bar_Data >= _Bollinger_Bands;
   _Compare2 = _MACD2 >= _MACD1;

   //Level 3
   _AND = _Compare1 && _Compare2;

   //Level 4
   if(_AND && !__isExist(0))_Open_Buy = OrderSend(Symbol(),0,0.1,MarketInfo(Symbol(),MODE_ASK),0,MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),MODE_POINT)*200,MarketInfo(Symbol(),MODE_ASK)+MarketInfo(Symbol(),MODE_POINT)*100,"",__STRATEGY_MAGIC + 0)>=0;
   return(0);
}

//Services
bool __selectOrderByMagic(int __magic){for(int __i=0;__i<OrdersTotal();__i++){if(OrderSelect(__i,SELECT_BY_POS,MODE_TRADES)&&OrderMagicNumber()==__STRATEGY_MAGIC+__magic)return(true);}return(false);}
bool __isExist(int __magic){return(__selectOrderByMagic(__magic));}

Can anyone put this for me

open sell if buy position closed with StopLoss