[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 41

 
hoz:

A funny question has come up. For example, I decide to open a buy order on a condition:

1. the fast wave1 crossed the slow wave2 from bottom to top. (What is important is not the moment of crossing, but that fast wave1 is higher than slow wave2).

2. The candlestick touched the fast 1, so we open a buy order.

I thought about it, and so I understand that we need to create conditions that if the price of the candle is approximately equal to the price of fast wave1 apparently with some specified deviation, right?

Basically, since the candlestick is currently at the top once the fastmask1 crosses the slowmask1 from the bottom, then over we need to compare the candlestick's low with the price of the fastmask1?

i.e.

But in this case the point is not taken into account that the candlestick is unlikely to be exactly at the price of iMA(fast), because the price can quickly jump through it and go further or rebound. So, we need to specify some range.

How to do it correctly?

Read all and set/correct!

  • SOFTWARE SOLUTIONS
Where do I start as a beginner?
HOW do I find the price of the last fractal?
HOW do I get a signal when two MAs cross?

HOW do I check MA crossing with respect to the required divergence?

...


 
Twilight:

It will be redrawn visually.

Cycle through the last N bars and if there was a signal then signal=true

And then you can do whatever you want with any other non redrawing indicators.

PostMessageA (WindowHandle(Symbol(), Period()), 0x0111, 33324, 0);

Where to insert? At the beginning of Start?

Thank you.


Silatyt:

Before you call the indicator (you can also put it at the beginning of start()).

P.S. Everyone is "running" from redrawing, and you are behind it - unconventionally... :))


Another question, I have 2 charts of one and the same currency open and it redraws in all windows at once. How to make it redraw only in 1 window? Is it a Hendle search?

Can you provide me with a code and example?

 

I am not interested in checking for a MA crossing, I need to open an order when a candle touches the MA...
 
hoz:

I'm not interested in checking for an MA crossing, I need to open an order when the MA is touched by a candle...

IMHO
Condition more or equal to Bid >= iMA (...) if touching from bottom to top and check on every tick.

OR check that Higth[0] of a bar is greater than or equal to >-iMA (...).

OR CLOSE[0] and the same.

if (fast0>=slow0 && Close[0]>=fast0) Print("Crossing UP");

Buy

 
hoz:

I'm not interested in checking for MA crossings, I need to open an order when a candle touches the MA...


if (MA на первом баре < Low [1]) 
   if (MA на нулевом баре >= Bid) {то входите в бай, если на отбой от МА}
 
Twilight:



It goes something like this.

In short, that's the way it should be done:

hparent=WindowHandle(Symbol(),Period());         // нашли хэндл графика скрипта
hparent= GetAncestor( hparent,2);                  // нашли основное окно
hactiv= GetDlgItem( hparent,0xE900);               // нашли окно с графиками
hactiv= GetWindow( hactiv, GW_CHILD);               // нашли 1-ое дочернее окно, оно текущее
// пробежать по остальным окнам
while( hactiv>0) {
   hactiv= GetWindow( hactiv, GW_HWNDNEXT);         // нашли следующее дочернее окно
}
Then
GetWindowTextA(hactiv,name,10);            // получили описание окна;

Parse it, compare it and get what you're looking for.

 
Roman.:

if (MA на первом баре < Low [1]) 
   if (MA на нулевом баре >= Bid) {то входите в бай, если на отбой от МА}


Roman, that's what I was asking. In fact, I was thinking along the same lines, but wanted to make sure I was thinking correctly by checking with the pros. Thank you.

 
Hi all ... guys Please tell me what's wrong ... my two-line code does not want to hum .

#property copyright "Copyright © 2012"
#property link      "Не ссать  против ветра "
 
 extern bool       Будильник      = true ;
 extern string SoundFile      =  "News.wav";
 
int start ()                                  
{
 double  a=iCustom(NULL,0,"HMA_Russian_Color",5,MODE_LWMA,PRICE_MEDIAN,0); 
 double  b=iCustom(NULL,0,"HMA_Russian_Color",8,MODE_LWMA,PRICE_MEDIAN,0); 
 
if (Будильник ==true)
{

  {
 if ( a > b ) 
       
 {  
  Alert("BUY");
  PlaySound(SoundFile);
  Sleep(100000);
  }
 }
}


return(0);}
here is an excerpt from the indicator itself
extern int period=21;
extern int method=0;
extern int price=0;
 
odiseif:
Hi all ... guys, tell me what's wrong ... my two-line code won't hum .(
here's an excerpt from the indicator itself
extern int period=21;
extern int method=0;
extern int price=0;

The indicator call is missing one variable - the buffer!!!

 double  a=iCustom(NULL,0,"HMA_Russian_Color",5,MODE_LWMA,PRICE_MEDIAN, N_Buf, 0); 
 double  b=iCustom(NULL,0,"HMA_Russian_Color",8,MODE_LWMA,PRICE_MEDIAN, N_Buf, 0);
 
TarasBY:

There is one variable missing from the indicator call - the buffer!!!


Three buffers are called in the indicator...thanks...I'll try it both ways...maybe it will work by gut feeling.