Can anyone code this simple EA? - page 5

 

The same as I posted earlier in post #34...with 0.1 lotsize (I apologize for posting an incorrect lotsize earlier..I later corrected it) It is a bug though as 1K should allow 1.0 lots...

ES

matrixebiz:
What settings?
 
ElectricSavant:
The same as I posted earlier in post #34...with 0.1 lotsize (I apologize for posting an incorrect lotsize earlier..I later corrected it) It is a bug though as 1K should allow 1.0 lots... ES

Ok, thanks. Do you find these settings work with all currencies? or do you use the Optimization feature in MT4 with the Strategy Tester?

 

No I use ATR

matrixebiz:
Ok, thanks. Do you find these settings work with all currencies? or do you use the Optimization feature in MT4 with the Strategy Tester?
 
ElectricSavant:
No I use ATR

ATR? Please explain

Thanks man

 

Average true range is an indicator in the MT4 library with a default setting of 14P (I often use 24P Daily or 576P H1)

For example why would the stops and TP's on a more volatile pair that had double the range be the same?...

Load all 19 IBFX pair on the platform with the ATR indicator and compare the readings.

Then figure out what the stops and tp's should be based on their differences...you could use a multiplier based off of the illustrated target pair as a base...if the other pair that you are thinking of using is 1.5 times more in it ATR value you could multiply the thread authors suggested stop loss and TP by 1.5.

There are other methods to determine a comparable sl or tp...this a is just one of them...some may not agree that ATR is the best one...

ES

matrixebiz:
ATR? Please explain Thanks man
 
matrixebiz:
Ok but also it initiates a trade as soon as I load it on a chart. I loaded it on a chart just now and it placed a trade even though it is out of my set boundaries. I have TZ=2, Sample=8 and Enable=1 and it just placed a trade?? Looks like it's not obeying the entry rules

Can you make it so it waits until then next entry point when you first load it on a chart.

Thanks

It's hard to see how the EA manages to make a trade outside of the enabling period, but in any case, I now uploaded a code update where the EA avoids making a trade if attached to a chart anytime after that the day's enabling period has begun.

 
ralph.ronnquist:
It's hard to see how the EA manages to make a trade outside of the enabling period, but in any case, I now uploaded a code update where the EA avoids making a trade if attached to a chart anytime after that the day's enabling period has begun.

Ok, can you please post it.

Thank you

 
matrixebiz:
Ok, can you please post it. Thank you

Still attached to post #2. Cheers.

 
ralph.ronnquist:
Still attached to post #2. Cheers.

No, I don't see it. Did you forget to attach it?

 

The attached EA might do what you expect (?).

Drop it on GBPUSD,H1

Parameters:

* SAMPLE_HOUR is the hour at which to sample the price (bid price)

* EXPIRES is the number of hours past SAMPLE_HOUR to expire

* OP is the pips offset off sample price required to trigger trade

* TP is the takeprofit pips offset off open price

* SL is the stoploss pips offset off open price

* lots is the trade size

Files:
arsenic.mq4  4 kb
Reason: