Re: Coding Help

#881
mrtools wrote:
Tue Dec 04, 2018 7:21 am
Daniele wrote:
Tue Dec 04, 2018 5:12 am
Hi Mladen, I have a problem with an indicator, it's called madistance and it's repaint so I can not use it well, can you fix it?
Try this version.
Hi mrtools, thanks, the version you entered is better because if I leave the indicator in a specific timeframe without changing it then does not make any repaint but if I change the timeframe and then go back to the previous timeframe the indicator makes repaint, you can fix also this detail?


Re: Coding Help

#882
Daniele wrote:
Wed Dec 05, 2018 1:29 am
mrtools wrote:
Tue Dec 04, 2018 7:21 am


Try this version.
Hi mrtools, thanks, the version you entered is better because if I leave the indicator in a specific timeframe without changing it then does not make any repaint but if I change the timeframe and then go back to the previous timeframe the indicator makes repaint, you can fix also this detail?
From what i can tell from the code the only way the oscillator can repaint if you are using a negative shift.

Re: Coding Help

#883
mrtools wrote:
Wed Dec 05, 2018 2:15 am
Daniele wrote:
Wed Dec 05, 2018 1:29 am


Hi mrtools, thanks, the version you entered is better because if I leave the indicator in a specific timeframe without changing it then does not make any repaint but if I change the timeframe and then go back to the previous timeframe the indicator makes repaint, you can fix also this detail?
From what i can tell from the code the only way the oscillator can repaint if you are using a negative shift.

But if I put the indicator on m1 and then move to another timeframe and return immediately on m1 the values ​​of the yellow line will be different so I am forced not to change the timeframe.

Re: Coding Help

#884
mrtools wrote:
Wed Dec 05, 2018 2:15 am
Daniele wrote:
Wed Dec 05, 2018 1:29 am


Hi mrtools, thanks, the version you entered is better because if I leave the indicator in a specific timeframe without changing it then does not make any repaint but if I change the timeframe and then go back to the previous timeframe the indicator makes repaint, you can fix also this detail?
From what i can tell from the code the only way the oscillator can repaint if you are using a negative shift.

I have to give an update about the repaint, I saw that it makes repaint even if I leave the indicator stationary in a single timeframe so you can not use it well. The first image is this morning and the second image I created it now and you can see that the values ​​are not the same as this morning's image.
ma distance 2.png
ma distance 3.png

Re: Coding Help

#885
Dear Sir,
I have quection how to increased the order???
EX: this EA only open 1 trade, but i want to open more trades (3 orders) at same time.
Thanks.


extern double Lots = 0.01;

extern int StopLoss = 300;

extern int TakeProfit = 50;

int g_bars_92;

bool gi_96 = TRUE;



int init() {

if (Digits == 3 || Digits == 5) {

StopLoss = StopLoss;

TakeProfit = TakeProfit;

}

return (0);

}



int deinit() {

return (0);

}



int start() {

if (g_bars_92 < Bars && TOOC() == 0 && g_bars_92 != 0 && gi_96) OrderSend(Symbol(), OP_BUY, Lots, Ask, 0, Bid - StopLoss * Point, Ask + TakeProfit * Point, 0, 0, 0, Red);

g_bars_92 = Bars;

if (TOOC() == 1) gi_96 = FALSE;

Comment("Error: ", GetLastError());

return (0);

}



int TOOC() {

int li_ret_0;

for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) {

if (OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES))

if (OrderSymbol() == Symbol()) li_ret_0++;

}

return (li_ret_0);}



}


Re: Coding Help

#886
hock87 wrote:
Wed Dec 05, 2018 12:09 pm
Dear Sir,
I have quection how to increased the order???
EX: this EA only open 1 trade, but i want to open more trades (3 orders) at same time.
Thanks.


extern double Lots = 0.01;

extern int StopLoss = 300;

extern int TakeProfit = 50;

int g_bars_92;

bool gi_96 = TRUE;



int init() {

if (Digits == 3 || Digits == 5) {

StopLoss = StopLoss;

TakeProfit = TakeProfit;

}

return (0);

}



int deinit() {

return (0);

}



int start() {

if (g_bars_92 < Bars && TOOC() == 0 && g_bars_92 != 0 && gi_96) OrderSend(Symbol(), OP_BUY, Lots, Ask, 0, Bid - StopLoss * Point, Ask + TakeProfit * Point, 0, 0, 0, Red);

g_bars_92 = Bars;

if (TOOC() == 1) gi_96 = FALSE;

Comment("Error: ", GetLastError());

return (0);

}



int TOOC() {

int li_ret_0;

for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) {

if (OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES))

if (OrderSymbol() == Symbol()) li_ret_0++;

}

return (li_ret_0);}



}
That looks like decompiled code. Have no idea!

Re: Coding Help

#887
mrtools wrote:
Wed Dec 05, 2018 2:15 am
Daniele wrote:
Wed Dec 05, 2018 1:29 am


Hi mrtools, thanks, the version you entered is better because if I leave the indicator in a specific timeframe without changing it then does not make any repaint but if I change the timeframe and then go back to the previous timeframe the indicator makes repaint, you can fix also this detail?
From what i can tell from the code the only way the oscillator can repaint if you are using a negative shift.

Hello mrtools, now I understand the problem of repaint, if you look at the post where I entered the 2 images you can see that the yellow line does not change then does not repaint but the red lines make the repaint, you think you can arrange the red lines ?

Re: Coding Help

#888
Daniele wrote:
Fri Dec 07, 2018 4:17 am
mrtools wrote:
Wed Dec 05, 2018 2:15 am


From what i can tell from the code the only way the oscillator can repaint if you are using a negative shift.

Hello mrtools, now I understand the problem of repaint, if you look at the post where I entered the 2 images you can see that the yellow line does not change then does not repaint but the red lines make the repaint, you think you can arrange the red lines ?
Think this is what they were trying to do but not sure.
EURUSDH1.png
Ma Distance + bands.mq4
(2.94 KiB) Downloaded 328 times

Re: Coding Help

#889
Dear Coders, Mladen and MrTools,
please improve / optimize the attached indicators in a way
they will work properly and smoothly for any broker, etc.
The indicators generate seconds chart(s) as an offline chart.
Thank you!
SandyEr7-3.0.AnySecond.mq4
(7.46 KiB) Downloaded 335 times
SandyEw7-2.4.mq4
(6.44 KiB) Downloaded 340 times


  1. Similar Topics

    1. iMAonArray - Coding help

      0 Replies 1016 Views

      by rogerha, Fri Oct 15, 2021 2:21 am in Coding Help

      0 Replies
      1016 Views
    2. 4 Replies
      910 Views
    3. Little coding help please!.... Cycle Bar indicator

      3 Replies 590 Views

      by codeCollector, Sun May 08, 2022 5:21 am in Coding Help

      3 Replies
      590 Views

Return to “Coding Help”

Users viewing this forum: CommonCrawl [Bot] and 3 guests