Easylanguage question

Hello,

I want to buy after two consecutive down gaps at the open of next day and sell at the close of same day. I'm trying to learn EL before I commit to an account. Will this code work?

if L[2] > H[1] AND L[1] > H[0] then begin
Buy Next Bar at open;
sell next bar at close;
end;

I don't know whether the sell command to exit position can be activated if inside the conditional and before a position is established.

Thanks,

Bill
 
Quote from intradaybill:

Hello,

I want to buy after two consecutive down gaps at the open of next day and sell at the close of same day. I'm trying to learn EL before I commit to an account. Will this code work?

if L[2] > H[1] AND L[1] > H[0] then begin
Buy Next Bar at open;
sell next bar at close;
end;

I don't know whether the sell command to exit position can be activated if inside the conditional and before a position is established.

Thanks,

Bill

I'm not sure but you may have to check MarketPosition first, like in:

If MarketPosition = 1 then
sell next bar at close;

John
 
Quote from intradaybill:
Hello,
I want to buy after two consecutive down gaps at the open of next day and sell at the close of same day. I'm trying to learn EL before I commit to an account. Will this code work?
if L[2] > H[1] AND L[1] > H[0] then begin
Buy Next Bar at open;
sell next bar at close;
end;
I don't know whether the sell command to exit position can be activated if inside the conditional and before a position is established.
For daily bars, that will basically work because the orders placed will most certainly result in fills. So in this particular case, MarketPosition is not really needed unless you want to place these orders only when already flat.
In that case, just qualify the orders:
If MarketPosition = 0 Then
if L[2] > H[1] AND L[1] > H[0] then begin
Buy Next Bar at open;
sell next bar at close;
end;
End;
 
Quote from intradaybill:

Hello,

I want to buy after two consecutive down gaps at the open of next day and sell at the close of same day. I'm trying to learn EL before I commit to an account. Will this code work?

if L[2] > H[1] AND L[1] > H[0] then begin
Buy Next Bar at open;
sell next bar at close;
end;

I don't know whether the sell command to exit position can be activated if inside the conditional and before a position is established.

Thanks,

Bill

This code will buy the open on the 3rd bar after 2 gaps down . The sell command is issued correctly and does not require a position before you send it.
 
Thank you all.

Another question: if the third bar forms another down gap, will the code generate a new entry at the open of the fourth bar?

Bill
 
Quote from Pro_Trader720:

Yes, assuming you are not filled on the 3rd bar.
No. If he does not use my code to check his MarketPosition, he will just increase the size of his long position.
 
Quote from syswizard:

No. If he does not use my code to check his MarketPosition, he will just increase the size of his long position.

only if he is allowing multiple entries.
 
Back
Top