Forum

Icustom

Hello everyone, I wanted to use the function "icustom" to extract the values of some indicators in an expert, assuming that I have the source of these indicators (so I can modify them). I attach the image where in the "data window" I have the variables: buy, sell, m15 TMA band, value2 and value 3

CloseAll function

Guys good evening I made this function that should cl ose me all open orders void CloseAll( int Magic) { for ( int i = OrdersTotal (); i >= 0 ; i-- ) { if ( OrderSelect ( i, SELECT_BY_POS ) && OrderMagicNumber() == Magic ) { for ( int k = 0 ; k < 10 ; k++ ) {

Take Profit Order Achieved but the order is not closed!

void TpModify( double tp) { double minstoplevel=MarketInfo( Symbol (),MODE_STOPLEVEL); double TakeProfit_B= NormalizeDouble (Ask+minstoplevel + tp* Point , Digits ); //BUY double TakeProfit_S= NormalizeDouble (Bid-minstoplevel - tp* Point , Digits ); //SELL for ( int i= OrdersTotal ()-

Counting open orders from an ae

Counting open orders from an ae Guys I created this function that should count orders opened by an ea int OrdiniAperti( int MagicNumberint) { int count= 0 ; for ( int i = OrdersTotal ()- 1 ; i >= 0 ; i--) { int tcket = OrderSelect (i,SELECT_BY_POS,MODE_TRADES); if (OrderSymbol() == Symbol () &&

Average touch

int BuySell = 0 ; int ToucMA( int TimeFrame, double MaPeriod) { // Per convenzione si usa // +1 = BUY // 0 = Tutto bene, ma non fa niente // -1 = SELL double Ima = iMA ( NULL , TimeFrame, MaPeriod, 0 , MODE_SMA , PRICE_CLOSE , 0 ); // MedIA ombra inf Media che taglia

Media with Levels

Good evening everyone I'm creating an ea that works on an average with "upper and lower level" now the code is as follows: int BuySell= 0 ; double SLBuy = 0 , TPBuy= 0 , SLSell = 0 , TPSell = 0 , Vol= 0 ; double Ma = iMA ( NULL , 0 , MediaPeriod, 0 , TipoMedia, PRICE_CLOSE , 0 );

Help Button

Hi guys, I created a button object for a marker (the code is below), when I "press it" It is all right and it executes the part of the code " //Button is pressed ", the problem is when I "resume" that should execute the part of the code " //Button is not pressed " instead it executes only " Print

Automatic Lots calculation

double CalcolaSize( double RischioIns){ double diff=MyStopLoss* Digits * Point ; diff= NormalizeDouble (diff, Digits ); Vol=(AccountFreeMargin()*RischioIns/ 100 )/(MarketInfo( Symbol (),MODE_TICKVALUE)*diff* MathPow ( 10 ,MarketInfo( Symbol (),MODE_DIGITS))); return NormalizeDouble

Dashboard

Guys Good morning, this function allows a button to change the croos and time frame of the window in which this indicator is inserted: { if (id== CHARTEVENT_OBJECT_CLICK && ObjectGet(sparam, OBJPROP_TYPE )== OBJ_BUTTON ) { if ( StringFind (sparam,UniqueID+ ":symbol:" , 0 )== 0 )

Decimal to full scale

Guys, I have this problem I did this function to determine the size of a candle The problem is that rightly returns me a Double value to me I would need entire ie the width of the candle, do you have ideas on how to solve? Thank you in advance // Candela Verde if (Open[ 1 ]<Close[ 1 ]) {