Invalid Stops error: What's wrong with this code?

 

When I use the 6 lines of code below, I get an invalid stop error. What's wrong with it?


double smallest_point = tick_size();//extra padding

double minimum_stop_step_size = MarketInfo(Symbol(),MODE_STOPLEVEL)*tick_size();
double minimum_stop_level =0;//initialize
if(trading_long){//
minimum_stop_level = trade_entry_level - minimum_stop_step_size;
}else{
minimum_stop_level = trade_entry_level + minimum_stop_step_size;//

}


(trade entry level is the point I am placing my buy stops and sell stops)


What can you tell me is wrong with it?

 
This code is non-formatted.
 
hitwill wrote >>

When I use the 6 lines of code below, I get an invalid stop error. What's wrong with it?

double smallest_point = tick_size();//extra padding

double minimum_stop_step_size = MarketInfo(Symbol(),MODE_STOPLEVEL)*tick_size();
double minimum_stop_level =0;//initialize
if(trading_long){//
minimum_stop_level = trade_entry_level - minimum_stop_step_size;
}else{
minimum_stop_level = trade_entry_level + minimum_stop_step_size;//

}

(trade entry level is the point I am placing my buy stops and sell stops)

What can you tell me is wrong with it?

tick_

 

Thanks, I just figured it out, actually. There was an error in one of the varibles.


I'm looking forward to reaeasing my ea to the community very soon. It finds entry points very efficiently and now its just to fine tune it,

Reason: