Intrinsic Knowledge
Member
Hi friends,
Please if any kind souls could help or guide the following questions in bold?
# Using engulfing for Long and Short
input length = 20;
input trendSetup = 3;
def BodyMax = Max(open, close);
def BodyMin = Min(open, close);
def IsEngulfing = BodyMax > BodyMax[1] and BodyMin < BodyMin[1];
def IsWhite = open < close;
def IsBlack = open > close;
def IsPrevDoji = IsDoji(length)[1];
plot longSignal = if IsDescending(close, trendSetup)[1] and (IsBlack[1] or IsPrevDoji) and
IsWhite and IsEngulfing then 1 else 0;
plot shortSignal = if IsAscending(close, trendSetup)[1] and (IsWhite[1] or IsPrevDoji) and IsBlack and IsEngulfing then 1 else 0;
def longStopLoss = lowest( entryPrice(),3 ) == 0; # Stoploss will be triggered based on lowest price of the last 3 bars from the entry price, am I coding this correctly?
def longProfit = longStopLoss*3; # How can I record the stop loss value(Even though it is not triggered) and return the profit target price? This allows the risk/reward ratio of 1:3.
def longExitSignal = if longStopLoss or longProfit then 1 else 0; # the condition will trigger whichever one come first
def longExitPrice = close;
def shortStopLoss = highest( entryPrice(),3 ) == 0; # Stoploss will be triggered based on highest price of the last 3 bars from the entry price, am I coding this correctly?
def shortProfit = shortStopLoss*3; # How can I record the stop loss value(Even though it is not triggered) and return the profit target price? This allows the risk/reward ratio of 1:3.
def shortExitSignal = if shortStopLoss or shortProfit then 1 else 0; # the condition will trigger whichever one come first
def shortExitPrice = close;
Many thanks in advance.
Cheers, Lui.
Please if any kind souls could help or guide the following questions in bold?
# Using engulfing for Long and Short
input length = 20;
input trendSetup = 3;
def BodyMax = Max(open, close);
def BodyMin = Min(open, close);
def IsEngulfing = BodyMax > BodyMax[1] and BodyMin < BodyMin[1];
def IsWhite = open < close;
def IsBlack = open > close;
def IsPrevDoji = IsDoji(length)[1];
plot longSignal = if IsDescending(close, trendSetup)[1] and (IsBlack[1] or IsPrevDoji) and
IsWhite and IsEngulfing then 1 else 0;
plot shortSignal = if IsAscending(close, trendSetup)[1] and (IsWhite[1] or IsPrevDoji) and IsBlack and IsEngulfing then 1 else 0;
def longStopLoss = lowest( entryPrice(),3 ) == 0; # Stoploss will be triggered based on lowest price of the last 3 bars from the entry price, am I coding this correctly?
def longProfit = longStopLoss*3; # How can I record the stop loss value(Even though it is not triggered) and return the profit target price? This allows the risk/reward ratio of 1:3.
def longExitSignal = if longStopLoss or longProfit then 1 else 0; # the condition will trigger whichever one come first
def longExitPrice = close;
def shortStopLoss = highest( entryPrice(),3 ) == 0; # Stoploss will be triggered based on highest price of the last 3 bars from the entry price, am I coding this correctly?
def shortProfit = shortStopLoss*3; # How can I record the stop loss value(Even though it is not triggered) and return the profit target price? This allows the risk/reward ratio of 1:3.
def shortExitSignal = if shortStopLoss or shortProfit then 1 else 0; # the condition will trigger whichever one come first
def shortExitPrice = close;
Many thanks in advance.
Cheers, Lui.