Re: Coding Help

881
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?


Re: Coding Help

882
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.

Re: Coding Help

883
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.

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

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.
Attachments

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

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 ?


Who is online

Users browsing this forum: No registered users and 17 guests