Can somebody please program a strategy for me?
I am looking to input a variable level for a buy trade outside the lower exponential Bollinger band (20, 2) (open). So, when the price moves a set amount below the Bollinger band it triggers a buy trade.
When the buy is triggered its puts a stop loss in of the same value. I.e.: I input a variable of 40 and when the price goes below the exponential Bollinger band (20, 2) (open) by 40 pips it triggers a buy trade with a stop loss level 40 pips below that.
And to have a target profit of 75% of the stop loss
Also,
I am looking to input a variable level for a sell trade outside the upper exponential Bollinger band (20, 2) (open) so, when the price moves a set amount above the Bollinger band it triggers a sell trade.
When the sell is triggered its puts a stop loss in of the same value. I.e.: I input a variable of 40 and when the price goes above the exponential Bollinger band (20,2) (open) by 40 pips it triggers a sell trade with a stop loss level 40 pips above that.
And to have a target profit of 75% of the stop loss
I need to be able to adjust the variable amount that the trade triggers by please.
I have this at the moment for sells trades and it seems to work?
Bollu=ExponentialAverage[20](open)+2*std[20](open)
nbpoint=25.4
c1 = (high > Bollu+nbpoint*pointsize)
IF c1 THEN
SELLSHORT 1 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS nbpoint
SET TARGET pPROFIT 19
And this for buys and it doesnt work correctly
Bolld=ExponentialAverage[20](open)-2*std[20](open)
nbpoint=25.4
c1 = (low < Bolld+nbpoint*pointsize)
IF c1 THEN
BUY 1 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS nbpoint
SET TARGET pPROFIT 19
Any ideas where I am going wrong and how do I put them together to work on 1 code?
Regards,
Gary