fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. damsiboko
    3. Posts
    D
    • Profile
    • Following 2
    • Followers 0
    • Topics 11
    • Posts 24
    • Best 0
    • Controversial 1
    • Groups 0

    Posts made by damsiboko

    • what's wrong in here?
      //!!! I must define all input properties here, because they are not automatically defined.
      	// This function is not global prototype, one new function is created for each case. This is because % iCustom % must be unique
      	
      	string symbol = Symbol;
      	ENUM_TIMEFRAMES timeframe = Period;
      	int buffer    = 1;
      	int shift     = Shift + FXD_MORE_SHIFT;
      	
      	double retval = EMPTY_VALUE;
      	int i;
      	double ival;
      	
      	if (ModeOutput == "id")
      	{
      		retval = iCustom(symbol, timeframe, "ccf1p-value" , buffer, shift);
      		
      	}
      	else if (ModeOutput == "time")
      	{
      		datetime time;
      		
      		if (0 && StringFind(TimeStamp, ":") == -1)
      		{	
      			time = (datetime)StringToInteger(TimeStamp); // hangs in MQL4!!!
      		}
      		else
      		{
      			time = StringToTime(TimeStamp);
      		}
      		
      		shift = iCandleID(symbol, timeframe, time);
      		retval = iCustom(symbol, timeframe, "ccf1p-value" , buffer, shift);
      	}
      	else if (ModeOutput == "visible" || ModeOutput == "id_by_visible")
      	{
      		if (VisibleLimit == 0) {VisibleLimit = iBars(symbol, timeframe);}
      		
      		int vid = 0;
      		
      		for (i = shift; i <= VisibleLimit; i++)
      		{
      			ival = iCustom(symbol, timeframe, "ccf1p-value" , buffer, shift + i);
      			
      			if (ival == EMPTY_VALUE || ival == 0) {continue;}
      			if (vid >= VisibleID) {
      				if (ModeOutput == "visible") {retval = ival;}
      				else {retval = i;}
      				break;	
      			}
      				
      			vid++;
      		}
      	}
      	else if (ModeOutput == "range")
      	{
      		int cstart = RangeCandleStart;
      		int cend   = RangeCandleEnd;
      		//string RangeValue = RangeValue;
      		
      		// reverse values, if needed
      		if (RangeCandleStart > RangeCandleEnd) {
      			int ctmp = RangeCandleEnd;
      			RangeCandleEnd = RangeCandleStart;
      			RangeCandleStart = ctmp;
      		}
      	
      		if (RangeValue == "max")
      		{
      			retval = -EMPTY_VALUE;
      			
      			for (i = RangeCandleStart; i <= RangeCandleEnd; i++)
      			{
      				ival = iCustom(symbol, timeframe, "ccf1p-value" , buffer, shift + i);
      				if (ival == EMPTY_VALUE || ival == 0) {continue;}
      				if (ival > retval) {retval = ival;}
      			}
      			
      			if (retval == -EMPTY_VALUE) {retval = EMPTY_VALUE;}
      		}
      		else if (RangeValue == "min")
      		{
      			retval = EMPTY_VALUE;
      			
      			for (i = RangeCandleStart; i <= RangeCandleEnd; i++)
      			{
      				ival = iCustom(symbol, timeframe, "ccf1p-value" , buffer, shift + i);
      				if (ival == EMPTY_VALUE || ival == 0) {continue;}
      				if (ival < retval) {retval = ival;}
      			}
      		}
      	}
      	else if (ModeOutput == "range_time")
      	{
      		datetime offset = 0;
      		if (RangeTimeSource == "gmt") {offset = (int)(TimeCurrent() - TimeLocal() + TimeGMTOffset());}
      		else if (RangeTimeSource == "server") {offset = (int)(TimeCurrent() - TimeLocal());}
      		
      		datetime time1 = StringToTime(RangeTimeStart)-(datetime)(86400*RangeDayOffset) + offset;
      		datetime time2 = StringToTime(RangeTimeEnd)-(datetime)(86400*RangeDayOffset) + offset;
      		
      		int x1 = iBarShift(symbol, timeframe, time1, false);
      		int x2 = iBarShift(symbol, timeframe, time2, false);
      		if (x1<x2) {x1=iBarShift(symbol,timeframe,(time1-86400),false);}
      		
      		if (RangeValue == "max")
      		{
      			retval = -EMPTY_VALUE;
      			
      			for (i=x2; i<=x1; i++)
      			{
      				ival = iCustom(symbol, timeframe, "ccf1p-value" , buffer, shift + i);
      				if (ival == EMPTY_VALUE || ival == 0) {continue;}
      				if (ival > retval) {retval = ival;}
      			}
      			
      			if (retval == -EMPTY_VALUE) {retval = EMPTY_VALUE;}
      		}
      		else if (RangeValue == "min")
      		{
      			retval = EMPTY_VALUE;
      			
      			for (i=x2; i<=x1; i++)
      			{
      				ival = iCustom(symbol, timeframe, "ccf1p-value" , buffer, shift + i);
      				if (ival == EMPTY_VALUE || ival == 0) {continue;}
      				if (ival < retval) {retval = ival;}
      			}
      		}
      	}
      	
      	return (retval);
      }
      
      posted in Questions & Answers
      D
      damsiboko
    • How can i use this custom indicator

      iCustom(NULL, PERIOD_CURRENT, "adp1p-value",0,current) > iCustom(NULL, PERIOD_CURRENT, "adp1p-value",1,current)

      Need to check for crossover of a custom indicator with two buffers showing the strength of each currency. How can that be done in fxDreema?

      posted in Questions & Answers
      D
      damsiboko
    • RE: Closing open trade when amount in deposit currency equals previous closed profit value

      @fxdreema said in Closing open trade when amount in deposit currency equals previous closed profit value:

      happen when the trade is on loss, so I set SL. That first Buy trade that was more

      Thanks, very good. Although need to get the current loss variable and then compute, that when LastTradeProfit equals current loss in value i.e +20 usd == -20 usd, then close trade. Meaning don't want to loose more than previous earned profit

      posted in Questions & Answers
      D
      damsiboko
    • Closing open trade when amount in deposit currency equals previous closed profit value

      How can an open trade be closed when the loss amount in deposit currency equals previous closed profit value ...

      posted in Questions & Answers
      D
      damsiboko
    • 1
    • 2
    • 2 / 2