Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // BUY CONDITIONS
- // Entry for a bull trade, exit for bear trade
- // simple conditions for example, using long TF
- // Look for a low above the lines (candle entirely out of the band)
- priceOverNegStDev1 = crossover(low, longDevLineBelow1) // Negative Standard Deviation (i.e. below the mean)
- priceOverNegGolden = crossover(low, longDevLineBelow2) // Negative Golden Deviation
- // Trigger a bull signal when conditions are met
- bullSignal = priceOverNegStDev1 or priceOverNegGolden
- // SELL CONDITIONS
- // Exit for bull, entry for bear
- // simple conditions for example, using long TF
- // Look for a high below the bands
- priceOverPosStDev1 = crossunder(high, longDevLineAbove1) // Positive Standard Deviation (i.e. above the mean)
- priceOverPosGolden = crossunder(high, longDevLineAbove2) // Positive Golden Deviation
- // Trigger a bear signal when conditions are met
- bearSignal = priceOverPosStDev1 or priceOverPosGolden
- // ________________________
- // ______ EXECUTION ______
- // BULL TRADE
- strategy.entry( "BULL", strategy.long, when=( bullSignal and isTimeRange ) )
- strategy.close( "BULL", when=( bearSignal and isTimeRange ) )
- // BEAR TRADE
- //strategy.entry( "BEAR", strategy.short, when=( bearSignal and isTimeRange ) )
- //strategy.close( "BEAR", when=( bullSignal and isTimeRange ) )
- // End of STRATEGY
- // *****************************************************************************
- // -----------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement