![]() dark green when the candle close is below the entry price (in a loss) Plotshape(exitShort, title = "Close SELL", style = shape.diamond, location = location.belowbar, color = color.red, size = size.large) Plotshape(exitLong, title = "Close BUY", style = shape.diamond, location = location.abovebar, color = een, size = size.large) Plotshape(enterShort, title = "Main SELL", style = iangledown, location = location.abovebar, color = color.red, size = size.large) Plotshape(enterLong, title = "Main BUY", style = iangleup, location = location.belowbar, color = een, size = size.large) ![]() Plot(stopLong, title = "Hard Exit Price", color = color.orange, style = plot.style_circles, linewidth = 2) Plot(entryPrice, title = "Entry Price", color = color.blue, style = plot.style_circles, linewidth = 2) InShort := shortEntryTrigger or (inShort and not exitCondition)ĮntryPrice = valuewhen(enterLong or enterShort, close, 0)īgcolor(filterLong ? C_UPTREND : filterShort ? C_DOWNTREND : na, title = "Trend Background Colors") InLong := longEntryTrigger or (inLong and not exitCondition) MACD = ema(close, fastLength) - ema(close, slowlength)ĮxitShort = crossover(MACD, aMACD) and MACD InTradeStop ? 0 : 1]))ĮxitTradeCondition = (inLong and exitLong) or (inShort and exitShort)ĮxitCondition = exitTradeCondition // stoppedCondition or exitTradeCondition - Function for a repainting/non-repainting version of the HTF dataį_security(_symbol, _resolution, _src, _repaint) => - Functions rounding OHLC to tick precisionįloat _op = round(open / syminfo.mintick) * syminfo.mintickįloat _hi = round(high / syminfo.mintick) * syminfo.mintickįloat _lo = round(low / syminfo.mintick) * syminfo.mintickįloat _cl = round(close / syminfo.mintick) * syminfo.mintick Var bool doShorts = (i_tradeDirection = TD3 or i_tradeDirection = TD1) Var bool doLongs = (i_tradeDirection = TD2 or i_tradeDirection = TD1) String i_tradeDirection = input(TD1, "Trade Direction", options =, group = GP1) Var color C_HARDEXIT = color.new(color.maroon, 25) Var color C_DOWNTREND = color.new(color.red, 80)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |