| 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 |
|
||||
|
Quote:
TRO Indicators |
|
|||
|
Hi,
First off thank you in advance for you help! I am trying to see if there is a way to use multiple threads in an expert advisor like you can in c++. The reason is, I do news trading and I need to have several orders all send at the same time. For example, I need to place 3 orders GBP/USD, USD/CAD, EUR/USD as soon as the data comes in. Now my problem is that if I use the regular order send function 3 times, it is slow, as it sends the orders incrementally, not at the same time. OrderSend("GBPUSD",OP_BUY,0.01,ask,5,ask-25*point,ask+25*point,"Cole",11111,0,Red); OrderSend("USDCAD",OP_BUY,0.01,ask,5,ask-25*point,ask+25*point,"Cole",11111,0,Red); OrderSend("EURUSD",OP_BUY,0.01,ask,5,ask-25*point,ask+25*point,"Cole",11111,0,Red); I am sure this can be done somehow because If I open up 3 separate MT4 buy/sell windows and click them all at the same time (using a news trading program), the orders all send at the same moment and come in much faster. When you do it this way, the orders all pop up at once, as opposed to using my EA with 3 OrderSend calls, they pop up one after another. Is there any way to setup multiple running threads in an EA, or perhaps is there some type of batch OrderSend? Thanks! Cole |
|
|||
|
Quote:
FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM NEW: video presentation of the Probability Meter ... 24hrs action on the website |
|
|||
|
Quote:
Here is the code i am using (not my code) to find the inside bar. } int IsInsideBar(int shift) { //Inside Bar, The close of the inside bar should be higher than both the close and the bar midpoint The current bar must open //equal or higher than the close of the inside bar a BuyStop order is to be placed at the high of the inside bar if the order //is not hit within the next 4 bars cancel order. See picture below if (High[shift]>High[shift+1]) return(0); if (Low[shift]<Low[shift+1]) return(0); if (Close[shift]>Open[shift] && Close[shift]>(High[shift]+Low[shift])/2 && Open[shift-1]>=Close[shift]) return(1); if (Close[shift]<Open[shift] && Close[shift]<(High[shift]+Low[shift])/2 && Open[shift-1]<=Close[shift]) return(-1); return(false); } Now, my question is: If I want to place a buy-stop and a sell-stop at the high and low of the next bar, the bar following the inside bar...what would the code be? Thanks for the help... forexcel |
|
|||
|
Hola
i want to close my position only if i'm in gain is this possible? where i wrong? Code:
for(cnt=0;cnt<total;cnt++)
{
//Seleziono quell'ordine
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && // check for opened position
OrderSymbol()==Symbol()) // check for symbol
{
if(OrderType()==OP_BUY) // long position is opened
{
if(OrderProfit() > 0,64$
{
if ( ... = true)
{
priceclose=OrderOpenClose;
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
lastgainl=OrderProfit();
lastclodeprice=OrderClosePrice();
//close my position
Question: -Is possible to have the gain in pip?like 50 pip and not in $? -How i close the position only is in gain? -Why if i print in comment "lastclosedprice" i can't see nothing? Part 2 I want to take a long/short only just prime on current time frame break 40 EMA And if cross the price don't close so far like max 10/12 pip if not i put a limit order at moving avrege price Code:
if(long==0 && LastClosedBar != Time[0] && Ask >= MA_40 && minprevius <= MA_40 && maxprevius >= MA_40) // so entry long is right???Thanks for Help |
|
||||
![]() As you can see from the pic. According to the rules, AC>0 && RSI>50 BUY AC<0&&RSI<50 SELL The indicator suppose to tigger BUY signals @ line 1,line 2 and line 3..... but due to my limiting in coding of metatrader,It only trigger at line 1. I do not know how to program the indicator to trigger another BUY signals @ line 2 and 3...I have some coding issue in looping... Please Help me out!!! I attach the same v2.11 beta indicator.. |
|
|||
|
I was wondering if it might be possible to take two types of code and combine them. I need to take the money management system (MM) from a martiangle EA, and apply it to a "Close ALL Profit Loss" EA. I am trying to get the "Close ALL Profit Loss EA" to adjust its closing profit value according to my ever growing balance. Right now I have to manually adjust my "Close ALL Profit EA" profit-goal settings according to my ever changing balance. If this is too complicated for a free-answer, then I understand.
|
|
||||
|
Quote:
Forex Factory - View Single Post - Sonic Indicator Project!! sonic |
![]() |
| Bookmarks |
| Tags |
| histogram, forex, ZUP_v1.mq4 |
| 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 10:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 12:46 PM | |