| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #1 | ||
![]() | Intraday Orders (EL) A new day begins. Then I want that a highest high (HH) of the day to be calculated. If a HH is created then I want to place my sell short stop next bar at X points below HH. The stop must be active till the end of the day until it's executed. An exit is at the end of the day. If the stop is not executed that day then the same condition but with new parameters takes place next day. Here is a picture of what I'm telling about: http://file.qip.ru/file/129903846/98.../Picture3.html I was able to write a code that sells short only on the next bar after a HH is formed and the condition is fulfilled, but I want that my stop be active until the end of the day. Last edited by GRANDEUR; 05-23-2010 at 02:29 PM. | ||
| |
|
| | #2 | ||
![]() | Re: Intraday Orders (EL) | ||
| |
|
| | #3 | ||
![]() | Re: Intraday Orders (EL) Quote:
line by line. write them out one action at a time, one action per line... one action per line... one action per line... one action per line... eventually you will get there.
__________________ Only an idiot would reply to a stupid post | ||
| |
|
| The Following User Says Thank You to Tams For This Useful Post: | ||
TIKITRADER (05-25-2010) | ||
| | #4 | ||
![]() | Re: Intraday Orders (EL) 2. A new day begins (today). 3. If high of a bar > all previous highs of today so far then that high is 'highesthigh' (HH). 4. HH is calculated each bar during the day. 5. We place a sell short stop order at (HH - 50 points). 6. That stop must be active till the end of the day. 7. If the order is not executed next bar and a new HH is formed then we cancel the order and place a new sell short order with the parameters as in (5). 8. If the order is not executed till the end of the day then we cancel the order. 9. If the order is executed then we buy to cover at the end of the day. 10. Loop. | ||
| |
|
| | #5 | ||
![]() | Re: Intraday Orders (EL) Quote:
are you expecting someone to do all the work for you?
__________________ Only an idiot would reply to a stupid post | ||
| |
|
| | #6 | ||
![]() | Re: Intraday Orders (EL) 3.If high of a bar > all previous highs of today so far AND IT IS > (TODAY'S OPEN+100) then that high is 'highesthigh' (HH). Here is what I wrote so far: if time=0930 then value1=open; if entriestoday(date)<1 and time>0930 and time<1630 and h>(value1+100) then value2=h; if entriestoday(date)<1 and time>0930 and time<1630 and h>(value1+100) then sell short next bar at (value2-50) stop; if time>1630 then buy to cover next bar at market; When I apply this code, trades are executed not at (HH-50) during the day but at (high [of the bar prior to entry]-50). | ||
| |
|
| | #7 | ||
![]() | Re: Intraday Orders (EL) 1. avoid using generic variables... ie value1, value2, etc., always create a meaningful variable names, because you will come back to the code 3 months from now and you have to scratch your head wondering what value101 is about. you have mention HH, why are you not using it in your code? 2. tag your codes, so that it is easy for everybody to read tagged codes look like this: Code: // This is tagged code if time=0930 then value1=open; if entriestoday(date)<1 and time>0930 and time<1630 and h>(value1+100) then value2=h; if entriestoday(date)<1 and time>0930 and time<1630 and h>(value1+100) then sell short next bar at (value2-50) stop; if time>1630 then buy to cover next bar at market;
__________________ Only an idiot would reply to a stupid post Last edited by Tams; 05-27-2010 at 03:18 PM. | ||
| |
|
| | #8 | ||
![]() | Re: Intraday Orders (EL) Quote:
Quote:
your logic description (1st quote) should mirror the code (2nd quote), so that you can go through the required tasks line-by-line.
__________________ Only an idiot would reply to a stupid post | ||
| |
|
| The Following User Says Thank You to Tams For This Useful Post: | ||
TIKITRADER (05-27-2010) | ||
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Intraday 1minute Data for Nasdaq | balapandian | Trading and the Markets | 3 | 06-21-2010 10:16 AM |