Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
you can't get a bool into your buycondition only by using "&&" and some conditions, use if() function...
hope this helps, otherwise it's a little step closer
Quote:
Originally Posted by payback
no i don't want to publish all but i think is a problem with the types match of variables i'll try to explain more
indicator1 e 2 are double right
so i have buyvaluecurrent = icustom(indicator1 etc etc);
buyvaluecurrent2 = icustom(indicator2 etc etc);
sellvaluecurrent = icustom(indicator1 etc etc); //doubles right?
trenendvup =icustom (indicator3 etc etc) ; //int
and so on
this statment works only sometimes and also could be a problem, so my question is why? i want that buycondition returns 1 or 0 no matter of what type is bool or double
so, all the conditions are false and stay false till the if() conditions are true.
Remove the StopLong & StopSell in "double", every other "double" can stay.
This will do it for you!
one stupid question everything inside the {} is your comment or i have to write it? and why? why {;} and not {}; ?
also can i still use this statment right?
PHP Code:
if(SellCondition) { ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order subCheckError(ticket,"SELL"); LastTrade = "SELL"; return(0);
or i have to write:
PHP Code:
if(SellCondition = true) { ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order subCheckError(ticket,"SELL"); LastTrade = "SELL"; return(0);
I'd like to thank everyone who has help me in the past. Righ now, i have a new request.
Can someone help me code this ea and here are the parameters:
My ea is based on an doji bar and an inside bar.
For an Inside bar :
Place a BUY-STOP/BUY-LIMIT at the HIGH of the next bar
Place a SELL-STOP/SELL-LIMIT at the LOW of the next bar
Clarifications :
Inside Bar is bar 0 (zero)
The next Bar is where we going to to place buy and sell limit or stop
The bar after next is where the long or short will be triggered.
On a one hour chart, if we have an inside bar at 9 AM, then we place our BUY-STOP or LIMIT and SELL-Stop otr LIMIT at the high and low of the 10 AM bar. The long or shor will be triggered at the 11 AM bar providing that price goes higher or lower than the 10 AM bar.
For a Doji bar :
Place a BUY-STOP/BUY-LIMIT at the HIGH of the previous bar
Place a SELL-STOP/SELL-LIMIT at the LOW of the previou bar
Clarifications :
Doji Bar is bar 0 (zero)
The Previoust Bar or Bar before the doji bar is where we going to to place buy and sell limit or stop at the high and low.
The bar after the doji bar is where the long or short will be triggered.
On a one hour chart, if we have doji bar at 9 AM, then we place our BUY-STOP or LIMIT and SELL-Stop otr LIMIT at the high and low of the 8 AM bar. The long or shor will be triggered at the 10 AM bar providing that price goes higher or lower than the 8 AM bar.
...maybe, it's not that simple. If it was i would have done it 2 weeks ago.
these are not comments, this is code.
they are a part of your if() statement.
if(SellCondition){
...
return(0);
}
if(SellCondition==true){
...
return(0);
}
both statements are ok, you can use one of them...
but see that every if() statement close with }
it doesn't show in your code that you provide here.
other example:
if(a==b){c=1; d=2; return(0);}
Quote:
Originally Posted by payback
one stupid question everything inside the {} is your comment or i have to write it? and why? why {;} and not {}; ?
also can i still use this statment right?
PHP Code:
if(SellCondition) { ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order subCheckError(ticket,"SELL"); LastTrade = "SELL"; return(0);
or i have to write:
PHP Code:
if(SellCondition = true) { ticket = subOpenOrder(OP_SELL,NewStopLossSell,TakeProfit,TicketComment); // open SELL order subCheckError(ticket,"SELL"); LastTrade = "SELL"; return(0);