|
|||||||
| 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 | Thread Tools | Display Modes |
|
|||
|
excuse me this expert sl have to using this formul for having profit result on thefix sl have bad result
order sl = ((MaxTrades*MinGS)+SL) - (n*MinGS) exampel for this info extern int MinGS=5; extern int TP=20; extern int SL=10; extern double lot=0.10; extern int MaxTrades=7; extern int RegularSpread=2; extern double Multiplier=2; extern double LotInc=0; extern double MarginLevelAlert=1000; we have first order sl= ((7*5)+10)-(0*5)=40 second order sl= ((7*5)+10)-(1*5)=35 and other sl are 35 30 25 20 15 |
|
|||
|
Help with an indicator
Hi
Ive tried to create an indicator and was wondering to see if someone can help me (i feel its 99.9% finished - well phase I anyway) //+------------------------------------------------------------------+ //| CCI_Stoc_Xover.mq4 | //| Copyright © 2007, MetaQuotes Software Corp. | //| Forex Trading Software: Forex Trading Platform MetaTrader 4 | //+------------------------------------------------------------------+ #property copyright "Copyright © 2007, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 SeaGreen #property indicator_color2 Red extern int CCI_Period = 14; extern int Stoc_K=5; extern int Stoc_D=3; extern int Stoc_Slowing=3; double CrossUp[]; double CrossDown[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0, DRAW_ARROW, EMPTY,3); SetIndexArrow(0, 233); SetIndexBuffer(0, CrossUp); SetIndexStyle(1, DRAW_ARROW, EMPTY,3); SetIndexArrow(1, 234); SetIndexBuffer(1, CrossDown); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int limit, i, counter; int counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(i = 0; i <= limit; i++) { counter=i; double cci_1 = iCCI(Symbol(), Period(), CCI_Period, PRICE_TYPICAL, 1); double cci_2 = iCCI(Symbol(), Period(), CCI_Period, PRICE_TYPICAL, 2); double stok_0 = iStochastic(Symbol(), Period(), Stoc_K, Stoc_D, Stoc_Slowing, MODE_SMA, 0, MODE_MAIN, 0); double stod_0 = iStochastic(Symbol(), Period(), Stoc_K, Stoc_D, Stoc_Slowing, MODE_SMA, 0, MODE_SIGNAL, 0); double stok_1 = iStochastic(Symbol(), Period(), Stoc_K, Stoc_D, Stoc_Slowing, MODE_SMA, 0, MODE_MAIN, 1); double stod_1 = iStochastic(Symbol(), Period(), Stoc_K, Stoc_D, Stoc_Slowing, MODE_SMA, 0, MODE_SIGNAL, 1); if ((cci_2 <= 0 && cci_1 > 0 && stok_1 < stod_1 && stok_0 > stod_0)) { CrossUp[i] = Low[i]; } else if ((cci_2 >= 0 && cci_1 < 0 && stok_1 > stod_1 && stok_0 < stod_0)) { CrossDown[i] = High[i]; } } return(0); } |
|
|||
|
Wolfe's Question
Quote:
If the indicator is standard in MT4, it will show up in the normal place. If it is called by iCustom, it will also show up, if coded right. The following EAs even have the indicators show on the chart window. Study them to learn how: bouncingPipEA_mpowerV42.mq4 bouncingPipEA_BigBear_v23.mq4 Big Be |
|
|||
|
Spread in Pending Order
Hi folks,
I made an EA that calculates daily hi-low between some period, and then place pending orders buystop/sellstop, that will expired in 12 hours. I run it in GBP-JPY pair (8 pips spread in my broker) Code:
int ticket, SL, TP; //SL= StopLoss , TP= TakeProfit int Spacing = 10; // Spacing Pips double vAsk = HighestPrice+Spacing*Point; // raise/lower 10 pips for OP Buystop/Sellstop , HighestPrice= some highest price ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,vAsk,0,vAsk-SL*Point,vAsk+TP*Point,"Pending Order BUY STOP",20070125,CurTime() + 12 * 3600,Green); My friend told me that manual Pending Order Buystop/Sellstop is executed without spread factor, but why it's different with placing order by EA ? So is there any mistakes in my code ? Thanks in advance. |
|
|||
|
Quote:
|
|
|||
|
how to get the information on the main chart
i have downloaded an indicator,which shows green/red arrow when the buy/sell signal come.
now i want to program my own EA based on this indicator. but i have only the ex4 file of this indicator(no source code) I want my EA read the indicator arrow on the mainchart and send the buy/sell order(green arrow==>buy, red arrow==>sell) is there any approach to get indicator arrow information on the main chart? thanks |
|
|||
|
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:
If the arrow is not a value of a buffer, it is an object. Select it to see its properties. Most of the time, it's easy to understand how the names are generate and then it will be possible to use ObjectFind(). The EA should watch ObjectsTotal(), and only when it is incremented it may try to recognize the last object. If the name is unknow, the EA cannot use OjectFind() and has to scan all objects to identify the last one. The last object is not obviously the one with the highest index (ObjectsTotal() - 1), but it's better to start to scan from the higest index as you probably can break faster. Now you have to compare the OBJPROP_TIME1 get by ObjectGet() to Time[0] or Time[1] for exemple, and check the color or the arrow type, or a substring of the name, to identify a buy or a sell signal. It seems complex but it is not. Try to write it and dont hesitate to ask more precisions if needed. |
|
|||
|
Quote:
Thanks for who is interested. 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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 04:22 PM |