Hello mikael,
That’s pretty easy. First look for the variation from yesterday:
|
var = 100-(DCLOSE(1) / DCLOSE(2))*100 |
Then test the “var” variable if it’s superior to your threshold (5% here), if so, then define the variable “allowtrade” to 0:
|
if ABS(var)>5 then allowtrade = 0 else allowtrade = 1 endif |
Then you can test this variable in your order launch conditions (example):
|
IF buycondition AND allowtrade=1 THEN BUY 1 SHARE AT MARKET ENDIF |
Tell me if it does the trick! 🙂