I'm currently working on a strategy and 1 of the criteria must be to measure the Risk/Reward ratio before it enters a trade. For this we need to know the stoploss and Target 1 of course.
For my stoploss I'm using the lowest low of the past 96 bars and get 10 pips below that price.
Target 1 = EMA
if (CCI(256)[0] > -50 && CCI(256)[1] > -50 && CCI(256)[2] > -50 && CrossAbove(CCI(256), -50, 3) && ((EMA(10)[0] - Close[0]) / ((Close[0] - Low[LowestBar(Low, 96)] - 10 * TickSize) >= 0.90))
{
EnterLong(30000, "LongEntry");
}
This is the code I'm trying out. The green letters work as I want it to be. From there I'm trying to add the next "block" of code, which is the Risk/Reward criteria.
The red letters are the code I entered to try and measure the Risk/Reward ratio as an entry criteria. Unfortunately this doesn't work as I want it to. As you can see I'm using it as a mathematical formula ( Reward / Risk >= 0.90)
Note that I'm a beginner with NT script coding.
Many thanks in advance for any comments and/or help.
Dennis
Comment