Hi!
I want to create a very simple (KISS!) stop and limit. I don't go for all these elaborate indicators like Donchian Channels (whatever they are). My strategy is a simple opening range breakout system where both the profit target and the stop are 100 points away from the entry price.
So, I created a variable called nEntryPrice like so:
Then once price has broken the opening range nEntryPrice is assigned the value of the current bar's open like so:
So far, so good. However, I then try to set my stop and limit using the following code:
but unfortunately this line of code gives me a syntax error. What I am I doing wrong?
I want to create a very simple (KISS!) stop and limit. I don't go for all these elaborate indicators like Donchian Channels (whatever they are). My strategy is a simple opening range breakout system where both the profit target and the stop are 100 points away from the entry price.
So, I created a variable called nEntryPrice like so:
Code:
var nEntryPrice;
Code:
if(!Strategy.isLong()) { Strategy.doLong("Long Break", Strategy.CLOSE, Strategy.THISBAR); nEntryPrice = open(0); }
Code:
if(Strategy.isLong) && (close(0) > nEntryPrice + 100) || (close(0) < nEntryPrice - 100) { Strategy.doSell("Long Exit", Strategy.MARKET, Strategy.THISBAR); }
Comment