this code originally came from a SCRIPT
I just threw in the "start();" in the init and deinit procedures to try to turn it into an EA
I have never used MQL language before!
Am I doing it right? or is it gonna crash and I'm gonna get the M$ BSoD? haha
int init()
{
start();
return(0);
}
int deinit()
{
start();
return(0);
}
can someone help me edit sar ohlc to use heiken ashi ohlc
Hi, I have an MTF indicator that uses sar, however I'd like the sar to calculate heiken ashi ohlc, and not the normal type
Can you tell me how I can do this, my mtf indicator calls to the sar indicator to calculate sar formula, I think it is calling to the internal indicator in mt4 that can not edit
you can skype or email if you can assist and like to talk about it
skype sty671
email sty671@gmail.com
I can also supply the original file that I'm trying to use heiken ashi ohlc for
ezrollin:
Am I doing it right? or is it gonna crash and I'm gonna get the M$ BSoD? haha
int init()
{
start();
return(0);
}
int deinit()
{
start();
return(0);
}
- Do not call start, mql4 will call it once per tick.
- Run it in the tester, add print statements so you can figure out what it is doing. If you can't figure how to get it to do what you want, post the code and the question.
can someone help me edit sar ohlc to use heiken ashi ohlc
- Don't hijack other peoples threads.
- No slaves here, learn to code or pay someone.
- Don't post the same exact question five plus times.
- Don't hijack other peoples threads.
- Don't post the same exact question multiple times
- Asked and answered on the other thread - OrderModify()
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How can I change this code so that it will work for multiple orders? thanks
int init()
{
start();
return(0);
}
int deinit()
{
start();
return(0);
}
//+------------------------------------------------------------------+
//| script "modify first market order" |
//+------------------------------------------------------------------+
int start() //| expert start function but its not an expert
{
bool result;
double stop_loss,take_profit,point;
int cmd,total,error;
//----
total=OrdersTotal();
point=MarketInfo(Symbol(),MODE_POINT);
//----
for(int i=0; i<total; i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
//---- print selected order
OrderPrint();
cmd=OrderType();
//---- buy or sell orders are considered
if(cmd==OP_BUY || cmd==OP_SELL)
{
//---- modify first market order
while(true)
{
if(cmd==OP_BUY) stop_loss=Bid-60*point; // on 4/13/11 I changed 20 to 40
else stop_loss=Ask+60*point; // on 4/13/11 I changed 20 to 40
//i wrote this part:
if(cmd==OP_BUY) take_profit=Bid+45*point;
else take_profit=Ask-45*point;
result=OrderModify(OrderTicket(),0,stop_loss,take_profit,0,CLR_NONE);
if(result!=TRUE) { error=GetLastError(); Print("LastError = ",error); }
else error=0;
if(error==135) RefreshRates();
else break;
}
//---- print modified order (it still selected after modify)
OrderPrint();
break;
}
}
else { Print( "Error when order select ", GetLastError()); break; }
}
//----
return(0);
}