| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #1 | ||
![]() | No Signals On BB System I have coded the following to get a system to buy a low bolinger band and sell a high bollinger band, but it will not take any trades. If I change the code to say If close¨of 1 bar ago is less than the lower band and the close is now above the lower band, then buy at market, and visa versa for shorts, then it does take the trades, but I want it to enter as it hits the lower band from below and the upper band from above, not wait till a close. Here is my code..... inputs: Length( 20 ), NumDevsUp( 2 ), NumDevsDn( 2 ); variables: Avg( 0 ), SDev( 0 ), LowerBand( 0 ), UpperBand( 0 ),BollingerPrice(0),Trade Line(0); BollingerPrice=Close of data1 / close of data2; TradeLine= Close of data1 / close of data2; Avg = AverageFC( BollingerPrice, Length ) ; SDev = StandardDev( BollingerPrice, Length, 1 ) ; UpperBand = Avg + NumDevsUp * SDev ; LowerBand = Avg - NumDevsDn * SDev ; if Tradeline< Lowerband then Buy next bar at Lowerband stop; if Tradeline> Upperband then Sellshort next bar upperband stop; if Marketposition>=1 and tradeline<Upperband then sell next bar at upperband stop; if Marketposition<=-1 and tradeline>Lowerband then buytocover next bar at Lowerband stop; Many thanks. | ||
| |
|
| | #2 | ||
![]() | Re: No Signals On BB System
__________________ Only an idiot would reply to a stupid post | ||
| |
|
| | #3 | ||
![]() | Re: No Signals On BB System Yes I already had this enabled for the strategy, but still no trades | ||
| |
|
| | #4 | ||
![]() | Re: No Signals On BB System Quote:
do you have this code in an indicator? if not, change the following code: Code: if Tradeline< Lowerband then Buy next bar at Lowerband stop; if Tradeline> Upperband then Sellshort next bar upperband stop; Code: if Tradeline< Lowerband then plot10(Lowerband, "B-Lowerband"); if Tradeline> Upperband then plot10(upperband, "S-upperband"); set the plot type to a large dot... you should be able to see if your logic is firing.
__________________ Only an idiot would reply to a stupid post | ||
| |
|
| | #5 | ||
![]() | Re: No Signals On BB System I made the indicator and it is plotting correctly, i.e. a red dot when over the upperband and a green dot when under the lowerband, so it is detecting when the conditions for entry are met, it is just that the system will not take any entries, as described in my first post Many thanks for your help. | ||
| |
|
| | #6 | ||
![]() | Re: No Signals On BB System Post a chart ( zoomed in ) showing BOTH symbols and timeframes with the indicators on, annotate the chart where there should be an entry and we'll have a better idea of what's what. Cheers Blu-Ray
__________________ “ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google | ||
| |
|
| The Following User Says Thank You to Blu-Ray For This Useful Post: | ||
Tams (10-22-2009) | ||
| | #7 | ||
![]() | Re: No Signals On BB System just remove the stop below: Quote:
p.s. 1. as Blue-Ray suggested, you should super-impose the price bar, BB, and indicators to see if the triggers are firing at the right places. 2. use the code box when posting codes. See the little "mountain" icon at the top of the message window. 3. always acknowledge helps people rendered you. You have 2 previous threads that you have not responded.
__________________ Only an idiot would reply to a stupid post | ||
| |
|
| The Following User Says Thank You to Tams For This Useful Post: | ||
Blu-Ray (10-22-2009) | ||
| | #8 | ||
![]() | Re: No Signals On BB System Attached is a zoomed in chart. the symbols are both stocks Do (data1) and Rig (data2) 5 min timeframe. The spread of data1-data2 is shown in white in the subraph, with bollinger bands of the spread in the same subgraph. Above this are the dots for the indi you suggested Tams, which show that it is detecting correctly when the spread is above / below the bollinger bands I tried to just remove the word Stop from the code as you suggested, but TS will not verify this, it states that there must be Stop, Limit or Shares at the end of the line of code Many thanks for your help | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multi System for Universal System Dr. Clayburg | philloo | Coding Forum | 7 | 01-18-2012 06:41 AM |
| Ease of Movement Signals | Tresor | Coding Forum | 4 | 08-05-2008 05:23 PM |
| Dual RSI + RSI Mid Line Signals | Tresor | Coding Forum | 3 | 07-28-2008 07:12 PM |
| [Warning Signals with Volume] | Soultrader | Trading Videos | 1 | 03-02-2007 05:55 AM |