Page 89 of 158
Re: Coding Help
Posted: Wed Dec 05, 2018 1:29 am
by Daniele
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
Posted: Wed Dec 05, 2018 2:15 am
by mrtools
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
Posted: Wed Dec 05, 2018 2:30 am
by Daniele
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
Posted: Wed Dec 05, 2018 4:49 am
by Daniele
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.
Re: Coding Help
Posted: Wed Dec 05, 2018 12:09 pm
by hock87
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
Posted: Wed Dec 05, 2018 12:53 pm
by mrtools
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
Posted: Fri Dec 07, 2018 4:17 am
by Daniele
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 ?
Re: Coding Help
Posted: Fri Dec 07, 2018 8:20 am
by mrtools
Daniele wrote: Fri Dec 07, 2018 4:17 am
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.
Re: Coding Help
Posted: Sun Dec 09, 2018 2:10 am
by wojtek
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!
Re: Coding Help
Posted: Sun Dec 09, 2018 10:58 am
by koros0111
Dear coders
is there anybody to help me find problems for this indicator?
thanks in advanced