What is the correct coding of Lowest Low Line?

 

Hi,

I try to develop a little logic using Highest High / Lowest Low 20.

I'd like to enter a short trade at LL20.

Opens Long trade, good: 
if (Bid = iHigh( NULL, 0, iHighest( NULL, 0, PRICE_HIGH, 20, 1 ) ) ); but doesn't open a short trade at: 
if (Ask = iLow ( NULL, 0, iLowest ( NULL, 0, PRICE_LOW , 20, 1 ) ) );

I need to use Ask, I think when entering short. It's maybe simple, but I'm newbie.

Help me, thanks.

 

I tend to think of short as sell as the code uses the word sell for short trades

Checking for Equivalance in an if statement is == Note 2 equal symbols together.

Don't look for equivalance in variables of type double (floating point) use greater than > and less than <

If bar 1 becomes the new highest high of 20 you will continue to put in short trades. Think about using the last highest high back from your 20 lowest low

 
  1. You need "if ( Bid == iLow" to even compile
  2. You want <= since double rarely compare equal.

See also Can price != price ? - MQL4 forum and Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 forum






Reason: