| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #1 | ||
![]() | Help with My First Strategy I've just bought Multicharts and I'm eager to start developing my own ideas for indicators and strategies based on those same indicators. But I've a big problem, I'm not that good in programming ![]() I'm able to understand most formulas but then, rearrange them or even rewrite them is a complete different world. I've been trying to write my first strategy, but thinks haven't gone as aspected. I thought I should begin with a simple buy order, but nothing happens. Can anyone help understanding what is happening and why? I'd appreciate all the help. Thank you Code: { *User Input*}
input :
length (5);
{ *Variables*}
variables:
dRng (0),
Mid (0),
Hi (0),
Lo (0),
Cl (0),
Vl (0);
Hi = High;
Lo = Low;
Cl = Close;
dRng = Hi - Lo;
Mid = (Hi + Lo) * .5;
Vl = Volume;
{ *Buy order* }
if (Cl > Cl [1]) and (dRng > Average(dRng,length)) then begin
if Vl > Average(Vl,length) then
Buy ("break") next bar open;
end; | ||
| |
|
| | #2 | ||
![]() | Re: Help with My First Strategy | ||
| |
|
| | #3 | ||
![]() | Re: Help with My First Strategy 1. no need to assign these values to variable. You can use them as is. Hi = High; Lo = Low; Cl = Close; Vl = Volume; 2. get this book Building Winning Trading Systems with tradestation Amazon.com: Building Winning Trading Systems with TradeStation: George Pruitt, John R. Hill: Books | ||
| |
|
| The Following User Says Thank You to Tams For This Useful Post: | ||
JBWTrader (09-27-2009) | ||
| | #4 | ||
![]() | Re: Help with My First Strategy Quote:
replace the keyword volume with ticks. Don't ask me why, in EasyLanguage... the keyword volume means "total upticks" in English, the keyword ticks means "total volume" in English. Last edited by Tams; 04-19-2009 at 12:48 PM. | ||
| |
|
| The Following User Says Thank You to Tams For This Useful Post: | ||
ptcman (04-19-2009) | ||
| | #5 | ||
![]() | Re: Help with My First Strategy Quote:
At is a Skip Word. Skip Words serve solely to improve the readability of EasyLanguage code and are skipped (ignored) during the compilation and execution. The use of Skip Words is optional; they can be inserted anywhere within the EL code and will appear red in Editor. | ||
| |
|
| | #6 | ||
![]() | Re: Help with My First Strategy Thank you all for your comments. OK, the above formula generates 1 buy order, the first time the condition is true. Now my question is, why only 1 order is created when this condition is true for dozens of time? I'm applying it in a 10 day historical 5 minutes chart. I've been trying to add a sell order, to close the long position, but I can't find any reserved word that specified if there's an open position then if the sell condition (low < low of the entry bar) is met then close position. I thought that writing an indicator was difficult Creating a strategy is starting to get much more difficultThank you | ||
| |
|
| | #7 | ||
![]() | Re: Help with My First Strategy Quote:
the keyword is: MarketPosition | ||
| |
|
| | #8 | ||
![]() | Re: Help with My First Strategy Returns a numerical value, indicating the type of the specified position. A value of 1 indicates a long position, A value of -1 indicates a short position, and A value of 0 is returned only if the current position is specified and indicates that the current position is flat. Usage MarketPosition(PosBack) Where: PosBack - a numerical expression, specifying the position: 0 - open position; 1 - one position back (the last position closed); 2 - two positions back, etc. If PosBack is not specified, a value for the open position will be returned. Note This function can only be used in signals. Examples MarketPosition will return a value of 0 if the current position is flat MarketPosition (1) will return a value of -1 if the most recently closed position was a short position source: EasyLanguage manual | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strategy for Es | TWI | Automated Trading | 6 | 10-28-2008 02:18 PM |
| Strategy Development | ephi144 | Beginners Forum | 7 | 10-21-2008 10:37 AM |
| {REQ} help with an exit strategy | jjthetrader | Coding Forum | 4 | 09-22-2007 01:06 PM |
| Simple fib Strategy | feb2865 | Technical Analysis | 1 | 09-19-2007 06:59 PM |
| What is your strategy when a trade goes against you | jperl | Technical Analysis | 15 | 05-22-2007 11:41 PM |