| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
|||
|
When you scan the orders collection by the "for" loop, you have to check if the selected order is on the current symbol, otherwize you will quickly do some greek salad...
PHP Code:
Last edited by Michel; 05-31-2007 at 08:46 PM. |
|
|||
|
multiple entries
hi, how to code multiple entires eg.....
// check for long position (BUY) possibility if ( Macd3 > Macd2 && Macd2 < Macd1 && Macd2 < -0.0045 ) if ( Macd3 > Macd2 && Macd2 < Macd1 && Macd2 < -0.0030 ) if ( Macd3 > Macd2 && Macd2 < Macd1 && Macd2 < -0.0015 ) I ran through the strategy tester and no trades opened but i deleted the 2 lines below and it was fine , please advise.. thx |
|
||||
|
Quote:
PHP Code:
__________________
"Don't work harder, work smarter." -- my Java professor Coder for Hire: http://www.firecell-fx.com |
|
||||
|
Code Question
Please disregard post. This setting did what I needed it to do. Thanks for begin there to help us.
I have modified an EA to work with several methods. I have done some research but can not figure out how to add the name of the EA to the comments field when opening an order. Can someone please point me in the right direction. I am hoping there is a simple string command that I can integrate into any EA I modify so that the orders are better organized when running more than one EA during a test. Thanks for your time and insight. OrderComment.JPG Here is one of the non-modified sections I will need to change to input the EA comment. Code:
if(ObjectFind(BuyStop_TrendName) == 0)
{
SetObject("Active" + BuyStop_TrendName,
ObjectGet(BuyStop_TrendName, OBJPROP_TIME1),
ObjectGet(BuyStop_TrendName, OBJPROP_PRICE1) + BuyStop_StepActive*Point,
ObjectGet(BuyStop_TrendName, OBJPROP_TIME2),
ObjectGet(BuyStop_TrendName, OBJPROP_PRICE2) + BuyStop_StepActive*Point,
ObjectGet(BuyStop_TrendName, OBJPROP_COLOR));
SetObject("Prepare" + BuyStop_TrendName,
ObjectGet(BuyStop_TrendName, OBJPROP_TIME1),
ObjectGet(BuyStop_TrendName, OBJPROP_PRICE1) - BuyStop_StepPrepare*Point,
ObjectGet(BuyStop_TrendName, OBJPROP_TIME2),
ObjectGet(BuyStop_TrendName, OBJPROP_PRICE2) - BuyStop_StepPrepare*Point,
ObjectGet(BuyStop_TrendName, OBJPROP_COLOR));
vA = NormalizeDouble(ObjectGetValueByShift("Active"+BuyStop_TrendName,0),Digits);
vM = NormalizeDouble(ObjectGetValueByShift(BuyStop_TrendName,0),Digits);
vP = NormalizeDouble(ObjectGetValueByShift("Prepare"+BuyStop_TrendName,0),Digits);
sl = vA - BuyStop_StopLoss*Point;
tp = vA + BuyStop_TakeProfit*Point;
if(Ask <= vM && Ask >= vP && OrderFind(MagicBuyStop) == false)
if(OrderSend(Symbol(), OP_BUYSTOP, BuyStop_Lot, vA, 3, sl, tp,"", MagicBuyStop, 0, Green) < 0)
Print("Err (", GetLastError(), ") Open BuyStop Price= ", vA, " SL= ", sl," TP= ", tp);
if(Ask <= vM && Ask >= vP && OrderFind(MagicBuyStop) == true &&
glbOrderType == OP_BUYSTOP)
{
OrderSelect(glbOrderTicket, SELECT_BY_TICKET, MODE_TRADES);
if(vA != OrderOpenPrice())
if(OrderModify(glbOrderTicket, vA, sl, tp, 0, Green) == false)
Print("Err (", GetLastError(), ") Modify BuyStop Price= ", vA,
" SL= ", sl, " TP= ", tp);
}
if(Ask < vP && OrderFind(MagicBuyStop) == true &&
glbOrderType == OP_BUYSTOP && AutoClose==true)
{
OrderDelete(glbOrderTicket);
}
}
Code:
if(OrderSend(Symbol(), OP_BUYSTOP, BuyStop_Lot, vA, 3, sl, tp,"CommentName", MagicBuyStop, 0, Green) < 0)
Print("Err (", GetLastError(), ") Open BuyStop Price= ", vA, " SL= ", sl," TP= ", tp);
__________________
Proverbs [James] Faith in Jesus helps me to see the invisible, believe the incredible and receive the impossible! He makes all things new in my life. Last edited by proverbs; 06-07-2007 at 04:08 PM. |
|
|||
|
Thank you Coderguru for being here for us!
I have a question about Alerts. I want to change the alert type in this code so it will play a wav file that I choose and not have the popup window buy sell thing. Just play wav file when fractal apears. How should the code be. I have attached the sFractals alert indicator. if(PrevSignal <= 0 ) { if(ExtDownFractalsBuffer[SIGNAL_BAR] > 0) { PrevSignal = 1; Alert("sFractals (", Symbol(), ", ", Period(), ") - BUY!!!"); } } if(PrevSignal >= 0) { if(ExtUpFractalsBuffer[SIGNAL_BAR] > 0) { PrevSignal = -1; Alert("sFractals (", Symbol(), ", ", Period(), ") - SELL!!!"); } } |
|
||||
|
Quote:
__________________
"Don't work harder, work smarter." -- my Java professor Coder for Hire: http://www.firecell-fx.com |
|
||||
|
Quote:
He hasn't been around in a while.Anyway.... add this statement: PlaySound("alert.wav"); .... where "alert.wav" is the name of the file that you want to play.
__________________
"Don't work harder, work smarter." -- my Java professor Coder for Hire: http://www.firecell-fx.com |
![]() |
| Bookmarks |
| Tags |
| histogram, forex |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
|
||||
| Posted By | For | Type | Date | |
| OzFx System:) - Page 639 | This thread | Refback | 06-21-2008 09:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 11:46 AM | |