Forum

Close all open position when certain margin level reached

Can someone guide me which's EA will force to close all of open positions (including profit and/or loss) if the margin level reach certain percentage? ​Thanks in advanced

How to Get Closest Value to a Number in Array

I have following code to get a list of values (double's type) in array. extern double Input_Double = 30.0 ; extern double Max_Tolerable = 2.0 ; extern int Input_Multiplier = 10 ; double iArray, iWaktu, iIndex; double ArrayAspect[][ 2 ]; int start() { int counted_bars=IndicatorCounted();

How to Count Total Number & Separate New Line the Label?

Hi guys, I want to count the total number & separate new line from the multiple of label (string) that have same value. Example: Sun Opposition with Mercury & Venus Opposition with Mars. At the moment, my code use OBJPROP_YDISTANCE & plus the range to separate the lines. So how to separate the same

How To Use iTime in The Future

I want to start the calculation of ShiftTime from spesific datetime in the future for BeginTime and skip calculation in current time before BeginTime (return nothing). datetime BeginTime = D'2018.09.01 00:00'; datetime ShiftTime = iTime(NULL, PERIOD_MN1, 1); I try this code, is it correct? int

Limit Value

Hello, How to limit the output which has results between some range values (for example): 240 < outputvalue < 250. Anyone have an example please? I am trying with this code, but give no result: int NumberLimit = 1 double outputvalue; for ( int i= 0 ; i<BarsLimit; i++) { int totals[];

Draw Vertical Line to Future Time

I can draw a vertical line from past date into current date but how to draw a vertical line into future date? I've been tried with this code but nothing happen: extern int FutureBars= 100 ; extern int BarsLimit= 1000 ; for ( int i=BarsLimit; i>= 0 ; i--) { datetime dailyTimefuture= Time [ 0

Draw Vertical Line on Spesific Date Every Month

Hello, I am trying to write an indicator to draw vertical line every spesific date on each month, example: draw vertical line every date: 14 January, 14 February, 14 March, 14 April etc... Something like this: extern string hour = "22" ; extern int width = 2 ; extern color Color = FireBrick; int

Possible loss due to conversion from Multidimensional Array

I have written the loop and inside it there's sorting for multidimensional array but when compile it giving this error. How can i solve this? double MyArray[][4]; int cnt=0; int Jindex=0; int start() { ...... for ( int i= 0 ; i<Limit; i++) { ArrayResize (MyArray, Limit); MyArray[cnt][ 0 ] =

How to Draw Lines without Buffer?

I can draw diagonal lines using indicator_buffers but it require many buffers. The prices change day by day starting from the beginning of pair's history by an external library. *note: please ignore the vertical lines How to draw this lines by using OBJECT_CREATE? I tried with below code: void

Draw Line on Array & MathPow

Hi All, Can anybody help me please? I have been trying to draw lines in an array that is in a sequence of square the array by using MathPow. This code only drawn 1 horizontal line only and without drawn fibonacci line: This how far have gone: #property strict #property show_inputs #property