[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 84

 
Roman.:


Sorry, didn't notice... :-)))

I checked several times - no errors, all strictly according to the formulas.

Apparently, it is necessary to divide the product into parts and then compare them... Read more - here.

Been there. Interesting. I have an idea. I'll write in the thread on the subject.

 
MaxZ:

Did you copy the whole code or just what was in the start() function? It's important!

You got it wrong! :)) For example, zig-zag does not have all elements of buffer filled. Also, it is not necessary to fill all buffer elements in icons.


Copying seems to be complete...

Strange! If I wrote code like this:

buffer[1]=open[1];

buffer[3]=open[3];

nothing happens on the chart

 
wolf05632:


I copied it completely...

Strange! If I wrote code like this:

buffer[1]=open[1];

buffer[3]=open[3];

nothing happens on the chart


You have to look at all the code in that case.
 
wolf05632:


Copying seems to be complete...

Strange! If I wrote code like this:

buffer[1]=open[1];

buffer[3]=open[3];

nothing happens on the chart

In this case you should change

SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,2);// Стиль линии

to

SetIndexStyle (0, DRAW_SECTION);

Otherwise halftracked lines will be drawn, or lines will jump from zero or up on the chart and fly back to zero or up again (depending on what value you give to the skipped elements in the buffer)! :D

So my code did work for you after all?

 

Thank you! I'll try again... Yes! It's working, thank you! Just a little unclear on the meaning of this line:

if (MathMod(Bars, 2) != 0 && Counted_bars == 0)
      return(0);
 
wolf05632:

Thank you! I'll try again... Yes! It's working, thank you! Just don't understand the meaning of this line a bit:

if (MathMod(Bars, 2) != 0 && Counted_bars == 0)
      return(0);

Let me explain.

We apply the indicator to a chart. First it executes the function init(), it is executed.

Then the function start() is executed. Since none of the bars has been calculated yet, the function will return zero to the variable Counted_bars.

IndicatorCounted(); // Количество просчитанных баров

will return zero.

It means that the condition

if (MathMod(Bars, 2) != 0 && Counted_bars == 0)
      return(0);

will not be met, and the indicator will calculate all of the bars of the symbol to which it has been applied.

After the calculation, the execution of function start() will be finished and the indicator will wait for a new tick to come.

When a new tick comes, the function start() will be executed again. In the Counted_bars variable, the function

IndicatorCounted(); // Количество просчитанных баров

will return the number of counted bars.

This means that the condition

if (MathMod(Bars, 2) != 0 && Counted_bars == 0)
      return(0);

can be already fulfilled, namely, this condition will be fulfilled when We don't need a bar and want to skip it in the calculation of the start() function.

 

Good evening. I have two questions:

1. I would like to ask if there is anyone on this forum who is developing a strategy based on the Ishimoku indicator and uses timeframe less than one hour, for example 5 or 15 minutes?

2. Terekhov A. Ishimoku Indicator.djvu book contains chapter " Ishimoku Indicator and Japanese Candlesticks" where it is written that the indicator should confirm candlestick configurations. So, these candlestick configurations must be present while the indicator gives a signal or there may be some bars between these two events? I.e., crossing tenkan and kinjun and at the same moment there should be a "hammer" or it is not obligatory?

 

Hello all, I am a beginner and I have a question - if I open an order according to this scheme

extern bool Buy = true;

extern double PriceBuy = 0;

int start()
{
if (Buy)
{OrderSend(Symbol(),OP_BUY,0.01,Ask,3,Bid-50*Point,Ask+50*Point);
PriceBuy = ??????????????????;}

return;
}
What should I specify under the question marks in order to assign the priceBuy variable to the order purchase price value? The purpose is to assign this value once and it will not change as the program progresses.

And one more - How to change the stoploss of an already open order programmatically?



 
OTPOK:

Hello all, I am a beginner and I have a question - if I open an order according to this scheme

extern bool Buy = true;

extern double PriceBuy = 0;

int start()
{
if (Buy)
{OrderSend(Symbol(),OP_BUY,0.01,Ask,3,Bid-50*Point,Ask+50*Point);
PriceBuy = ??????????????????;}

return;
}
What should I specify under the question marks to assign the order buy price value to the PriceBuy variable? The purpose is to assign this value once and it won't change as the program progresses.

One more question - how to change programmatically stoploss in an open order?




extern bool Buy = true;
extern double PriceBuy = 0; 
int start() 
{
   if(Buy) 
   {
     int ticket=OrderSend(Symbol(),OP_BUY,0.01,Ask,3,Bid-50*Point,Ask+50*Point);
     if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
        PriceBuy=OrderOpenPrice();
   }
   return(0); 
}
 
OTPOK:


What should we specify below the question marks in order to assign the priceBuy variable to the order buy price value? The purpose is to assign this value once and it won't change as the program progresses.

And one more thing - How do I change the stoploss of an already open order programmatically?




Good afternoon. I understand that you have never assigned values to variables. It's very easy to do.

PriceBuy=Ask

And you have to change the stoploss using the OrderModifity() function.

Use the MetaEditor help.

Goodbye.

Reason: