0% found this document useful (0 votes)
6 views1 page

Inverse Oil

Uploaded by

nourchip95
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Inverse Oil

Uploaded by

nourchip95
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.

0
at [Link]
// © ArmelloGang

//@version=5
strategy('Inverse Oil', overlay=true)
comparatorSymbol = [Link]('Oanda:BCOUSD', title = 'Comparator Symbol')
triggerPerc = [Link](2, title = '% move in candle to trigger', step =0.05) /
100
closeTrigger = [Link](0.8, title = '% move to close trade', step=0.05) / 100
tp = [Link] (2, 'Take Profit', step = 0.05)/100
sl = [Link](1, 'Stop Loss', step = 0.05)/100
candleOpen = [Link](comparatorSymbol, [Link], open)
candleClose = [Link](comparatorSymbol, [Link], close)
bull = candleOpen / candleClose > 1 + triggerPerc
bear = candleClose / candleOpen > 1 + triggerPerc
bullClose = candleClose / candleOpen > 1 + closeTrigger
bearClose = candleOpen / candleClose > 1 + closeTrigger
plotshape(bull,text ='Long Scalp', style=[Link],
location=[Link],
color=[Link],size=[Link],textcolor=[Link], offset=1)
plotshape(bear,text = 'Short Scalp', style=[Link],
location=[Link], color=[Link], size=[Link],
textcolor=[Link], offset=1)
var float shortsl = na
var float longsl = na
var float longtp = na
var float shorttp = na
if bull
longsl = close * (1 - sl)
longtp = close * (1 + tp)
[Link]('Long', [Link], stop=longsl, limit = longtp)
[Link]('Long','Long', limit= longtp, stop = longsl)
if bear
shortsl = close * (1 + sl)
shorttp = close * (1 - tp)
[Link]('Short', [Link], stop=shortsl, limit = shorttp)
[Link]('Short','Short', limit= shorttp, stop = shortsl)
if strategy.position_size > 0 and bullClose
[Link]('Long')
if strategy.position_size < 0 and bearClose
[Link]('Short')

You might also like