IPB

Welcome Guest ( Log In | Register )

 Digg this topic · Save to del.icio.us · Slashdot It · Post to Technorati · Post to Furl · Submit to Reddit · Share on Facebook · Fark It · Googlize This Post · Add to ma.gnolia · Tag to Wink · Add to MyWeb · Add to Netscape
Reply to this topicStart new topic
Probleme mql4.
Mangusta
post Apr 19 2008, 10:46 AM
Post #1





Group: Members
Posts: 89
Joined: 15-December 06
From: bucuresti
Member No.: 1,326



Am inceput sa fac un expert simplu pentru a invata mql4.
Am facut un expert care cumpara pe baza de iMA() [medii mobile].Daca linia trece peste alta linie intra pe pozitie in buy.
Am compilat EA-ul si nu are errors sau warnings.Il testez cu strategy tester si nu imi deschide nici un ordin.Eroarea este :
CITAT
OrderSend error 138
invalid double number as parameter 6 for OrderSend function

Functia de order send arata asa :
CITAT
extern double StopLoss =35;
extern double TakeProfit =75;
....
if (Curs>MA1){
tiket=OrderSend(Symbol(),OP_BUY,Lots,Ask-StopLoss*Point ,Ask+TakeProfit*Point,"Tunel",0,0,Red);
if (Curs<MA1) {
OrderClose(tiket,Lots,Ask,Red);
return(0);
}
}

In codul de mai sus am vrut sa spun cand "Curs" trece deasupa lui "MA1" deschide un ordin buy iar cand "Curs" ajunge sub "MA1" inchide ordinul deschis precedent.

Nu imi dau seama unde poate fi greseala.

Alta intrebare:
Care este diferenta intre a declara indicatorii in functia init() si in functia start ()?
Go to the top of the page
 
+Quote Post
nicugh
post Apr 19 2008, 12:44 PM
Post #2





Group: Members
Posts: 115
Joined: 8-March 06
From: Roman
Member No.: 759
Trading since: 2005



QUOTE(Mangusta @ Apr 19 2008, 11:46 AM) *
tiket=OrderSend(Symbol(),OP_BUY,Lots,Ask-StopLoss*Point ,Ask+TakeProfit*Point,"Tunel",0,0,Red);


ai o mancat ceva cuvinte din propozitie:double price, int slippage,
tiket=OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)

deci corect ar fi:

tiket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point ,Ask+TakeProfit*Point,"Tunel",0,0,Red);


--------------------


Go to the top of the page
 
+Quote Post
Mangusta
post Apr 19 2008, 04:33 PM
Post #3





Group: Members
Posts: 89
Joined: 15-December 06
From: bucuresti
Member No.: 1,326



@nicugh
Multumesc pentru raspuns.

Cum inchid ordinul deschis mai sus ? Eu m-am gandit sa folosesc functioa OrderClose in interiorul primului if care deschide ordinul.[Vezi in primul post codul]
Go to the top of the page
 
+Quote Post
Ad Bot
post
Post #


Ads









Go to the top of the page
 
Quote Post

Welcome Guest ( Log In | Register )


Reply to this topicStart new topic
1 User(s) are browsing this forum (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts  
3 johny_english 118 3rd January 2009 - 01:29 AM
Last post by: Stefan
No New Posts
6 4di 828 1st September 2008 - 07:39 AM
Last post by: 4di
No New Posts  
9 victor007 1,116 25th June 2008 - 08:28 AM
Last post by: Mangusta
No New Posts  
0 Stefan 1,117 25th March 2008 - 05:17 PM
Last post by: Stefan
No New Posts  
3 Stefan 1,983 14th February 2008 - 05:43 PM
Last post by: RSS Bot



RSS Lo-Fi Version Time is now: 10th January 2009 - 03:28 AM

Informatiile de pe vamist.com NU reprezinta recomandari de tranzactionare. Nu ne asumam niciun fel de raspundere pentru neplacerile ce pot aparea in urma folosirii acestor informatii.

Partners: Descopera lumea | Anunturi imobiliare video | E-learn.ro - Tutoriale in limba romana | Afaceri | Ziar financiar electronic | Magazine virtuale