Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.
flyingdutchmen
Members-
Content Count
114 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Articles
Everything posted by flyingdutchmen
-
note this maxbarsback is valid for each and every script that uses an fix amount of bars before the first calcuation made is able to give correct value's; this does not only apply for loops. i allways try to write my script in a way it does never have the "need" for gathering historical data aka "looking back". all data stored in arrays and variables are ohlc values of current bar without using any displacements ( [1] ). i never have the need of using displacements, then the skript will not start before all arrays are filled to the max index edit: this ofcourse is not of value to the one's simply wanting to calculate a standard indikator like an rsi,macd,ma etc. i do not use any of them
-
do you need this for discretionair trading and therefore actually want to see the rangebars as chart or is your intention to build an system on the rangebars ? a while ago i was working on a litle project which required rangebars to eliminate the time fractor and it had to do be done in ts2000i, what i did is i created my own "virtual" rangebars stored inside arrays by calculating the moves which price made
-
EL: Get High of a Bar from a Specific Time Yesterday
flyingdutchmen replied to TraderFoo's topic in Coding Forum
which part do you find complicated? if you run your code like this on here, it will give you an entry each session. this is not what you wanted to achieve in your initial post.you are not making sure there has not been any exit at the same session -
pls give me some time on this one, i am not able to verify this piece of code; there are to many words not being recognized by 2000i. this isnt a big issue from the looks of it you simple need to delete all plot and text statements and add the three that you would like to have on your chart from last session; but my guess is that will be to many variables left unused going that path. if there is no need for them anymore then there will be no reason for them to remain in the script and being calculated. this could take a bit, sorry.if anybody else is willing to give him an hand with this before i have it done i would not be mad
-
it would be easyer if you would let me know where exactly help is needet, what would you like to do or change
-
EL: Get High of a Bar from a Specific Time Yesterday
flyingdutchmen replied to TraderFoo's topic in Coding Forum
what you could do is following Variables: EP(0); If D <> D[1] Then EP = Open+(500*( MinMove/PriceScale )); Condition1 = EntriesToday(Date) = 0 and ExitsToday(Date) = 0 {and any other condition you willing to use to make the purchase}; If Condition1 and High < EP Then Buy Next Bar EP Stop; SetStopLoss(1000); If Time = 2000 Then Sell;{here the time of the last bar of the session to exit at the open of the first bar of the next session} note: if your stoploss will get triggered on the same day as the day of entry you could face another entry the next session, if you do not want to make that trade on the next session then we could build a simple counter to avoid this, to me this litle socalled system does not make any sence as it has zero sensetivity to changes in volatility. remember you will not recieve entries each second day as there will be days that your entryprice will not get reached. if your software does not support the function ExitsToday let me know. -
EL: Get High of a Bar from a Specific Time Yesterday
flyingdutchmen replied to TraderFoo's topic in Coding Forum
i allready gave you the solution, one must understand there are differents between 1)Buy Next Bar at Open + xxx Stop; and 2)Buy at Open of Next Bar + xxx Stop; 1) will place an stop order at the next bar using the open of this bar, this one you could use like this.. (on the new session) If High < Open+xxx Then Buy Next Bar at Open+xxx Stop; 2) will place an stop order at the next bar using the open of next bar, this one you use on the last bar of current session like this (on the last bar of old session) If Condition still Valid Then Buy at Open Of Next Bar+xxx Stop; there is absolutely no difference between them beside the fact if you are using example #1 you will need to make sure that your entrypoint has been been reached yet either way you will recieve the open of the first bar of the new session as starting point, the number of bars do not matter as you dont trade time but price; as long as price did not reach your entry you still have the possebility to place an order at that price -
EL: Get High of a Bar from a Specific Time Yesterday
flyingdutchmen replied to TraderFoo's topic in Coding Forum
"of tomorrow" will be ignored making your order behave like a normal "next bar"-order; you will need to place an order on the first intraday bar on the next trading session which gives you an entry on the second bar of the bar (buy next bar open), or you check on the very last bar of the current session if your conditions are still valid and if so place an order on the open of next bar that last bar(buy at open of next bar). -
that could very well be Frank, i am not certain as i do not have the possebility to test the code in my version of ts; this is how i remember reading it.give it a try and verify it as an indicator and see what will happen. i never use a code that way, i allways tend to set value's that i do not wish to use anymore to an extreme number like -99999 which makes that further calcuations ignore them.
-
http://www.traderslaboratory.com/forums/f56/volume-splitter-5824.html
-
1) one must understand that after an array has been declared it has been declared with a certain amount of index-places and a certain initial value at each of those index places. these value's can not be "cleared out". what one could do is give that specific index place in the array which value you would like to be deleted/cleared out a number below the lowest number which you find usable for your script, for example "-999999" and later loop trough that array to find only all value's ABOVE that number and make only use of those value's. because i am using the 2000i version i am not able to make use of all current array functions and reserved words and most of the time must be creativ to find a way around them to achieve the same outcome. while using multi charts or one of the newer tradestation versions one could go around this by declaring arrays as "dynamic". dynamic arrays can be in or de-creased in size at a later stage by making use of array_setmaxindex, this process wenn increasing the index places will set those value's at the new index places just created inside this array to the initial value at what the array initialy has been decleared. one could sort the array before decreasing to have the number you would like to be erased at top ( highest index ). i am not able to check this in 2000i but it gives you an idea about how to decrease arrays and erase specific values, at the end of the code you should have created a decreased array which no longer holds the values that you found not usefull anymore. Array: MyArray[](0), { create dynamic array } MyDummyArray[100](0); { create dummy } { create index, set to 5 } If CurrentBar = 1 Then Condition1 = Array_SetMaxIndex( MyArray, 5 ); { fill with values if creating index to 5 has been succesfull } If Array_GetMaxIndex( MyArray ) = 5 Then Begin MyArray[0] = 5; MyArray[1] = 3; MyArray[2] = 1; MyArray[3] = 7; MyArray[4] = 9; MyArray[5] = 4; End; { now we would like to erase value 3 and 7 } If CurrentBar = 1000 { or any other condition } Then Begin Value1 = 2; { we have chosen to decrease the dynamic array by 2 places, from 5 to 3 and we want te delete only value 3 and 7 } Value2 = -1; { set initial counter to -1 } For Value3 = 0 To Array_GetMaxIndex( MyArray ) { loop trough the still existing 5 index dynamic array } Begin If MyArray[Value3] <> 3 and MyArray[Value3] <> 7 Then Begin Value2 = Value2 + 1; { increase counter by 1, first step makes it set to 0 } MyDummyArray[Value2] = MyArray[Value3]; { if value different then 3 or 7 then apply value to dummy array starting at index 0 } End; End; Condition1 = Array_SetMaxIndex( MyArray, Array_GetMaxIndex( MyArray ) - Value1 ); { decrease in size } For Value3 = 0 To Array_GetMaxIndex( MyArray ) Begin { loop trough new decreased array } MyArray[Value3] = MyDummyArray[Value3]; { give back remaining values to new decreased array } End; value4 = 0; For Value3 = 0 To Array_GetMaxIndex( MyArray ) Begin If MyArray[Value3] = 3 or MyArray[Value3] = 7 Then Value4 = 1; { check if value 3 and 7 are part of the array and set a print statement to verify } End; Print( CurrentBar, Value4 ); { if succesfull then the print should show from barnumber 1000 a "0" if value 3 and 7 would be gone } 2) the most common way to keep writing in an array and dropping only the oldest value of the index number above the highest index at which the value was decleared would be to move/shift all value's back inside the array 1 index before which lets you drop only last value and store the new value at index 0. example Array: MyArray[100](0); { create 101 index array with initial values set to 0 } If { my condition ocours } Then Begin For Value1 = 100 { your max index } Down To 1 Begin MyArray[Value1] = MyArray[Value1-1]; { shift back values 1 index and drop only last(first) value } End; MyArray[0] = AnyValue; { only write at index zero each time the condition ocourse at which you would like to store a new value } End; please define 3 & 4, what exactly do you wish to be doing, veryfing your own work by using a "watch" ?
-
my apologies Tams, i understooth you wanted a picture of some kind of indicator to get this tread started.my wrong.
-
your request is a mockup, note most of my work is of statistical nature. i mainly run statistics on constant range bars to find high probability setups; for this i have some scripts existing out mainly homemade functions not providet by ts. i do not use traditional TA that is widely known in most forums, if it has an name allready it is not for me. i could show you a picture as requested but it will show you at most 2 simple plots/lines which will not be very usefull to others. like i mentioned before i could make a "fancy" indikator but i do not enjoy doing so are they are not of any help to me.let me see if i could find a script that i could share here, just offering some help here
-
i will ad one more it will keep running like Tam's loop untill the "Until" condition is met. This Loop is not yet supported in the old 2000i version but i believe it is supported in the newer versions of TradeStations and most likely in MC. it will produce the exact same outcome as the loop in the last post with the exeption that there is no need for "Begin" or "End" regardless of how many statements one would place between and this one is likely a bit easyer to understand for "LoopStarters" HighPriceSum = 0; BarBackNo = -1; Repeat BarBackNo = BarBackNo + 1; HighPriceSum = HighPriceSum + High[ BarBackNo ]; Until BarBackNo = 9;
-
EL: Get High of a Bar from a Specific Time Yesterday
flyingdutchmen replied to TraderFoo's topic in Coding Forum
HighD(1) and LowD(1) will not give you different value's at each bar within an intraday chart as they are daily values stored in an array. if you try to average those data's as you are trying to do, you will average two times the same value as HighD(1) will give you the high of yesterday on this bar but also on the next bar untill there is a change of date. what you could do is something like this If D <> D[1] Then value1 = ((HighD(1)+HighD(2))/2) - ((LowD(1)+LowD(2))/2); if you need more value's then only 2 days i would recommend using a loop but for 2 days this should do the trick. here is another way you could do it,; as your calculation of daily high minus daily low represents the same as the function "Range" there is a way you could use the calculation you have made yourself but in a slight different way. open another subchart of the same symbol, this time change the timeframe to be daily. you now have the same symbol ntraday and daily in the same chart. Value1 = Average( Range of Data2, 2); if you place this on your intradaychart it uses the data of the second chart which exists from daily bars and therefore should give the exact same result as first example, only this time you are able to average by a N number without using any loop -
i am offering help here to everyone who is stuck with their EL code or has an idea about some indikator/function/strategy which he thinks could be usefull to him/her but does not know how to produce this.i am running ts2ki and i am pretty new to this software, having recently quit my old easy language compatible software tradesignal, so this should be a nice learning experience for me. i will try to make anything you want, i must say i am better with complicated calculations then i am with the socalled "fancy TRO kind of indikators" with hundreds of lines and colors.please make sure if help is requested to be able to explane what you want me to do for you, do not come with any MT4 skript or other language with a request of please convert it to easy language so it can be used in tradestation.if you are not able to explane what exactly you want it to do i will most likely not be able to help you. if you prefere it to be not open to others send me a pm with your request, but i prefere to post the solutions/scripts here in the tread so they could be of help to others that are maybe having similair idea's or diffeculties in a later stage. open to questions and requests
-
Building a VolumeProfile Indicator with EasyLanguage
flyingdutchmen replied to Andytick's topic in Coding Forum
so are a couple thousand variables, by trying not forcing them into some weird function by having an "end;" statement in your script if the same can be achieved by an "end else" and they are just fine, even with loops. more important is to check the logic of the script once done and see if maybe somewhere you could replace a loop by a simple counter and see if it doesnt force to much. -
a litle note wenn using calculations inside loops, if one is trying to aply value(s) to a certain variable make sure to reset the variable to "0" or whatever initial value you would like to use before the beginning of the loop. if you do not do this it will take the old value of the former candle calculated from last loop and it will use that value to apply next value's resulting in wrong calculations it does not matter if you use a "for", "while" or "repeat / untill"-loop in this example you will recieve a correct value only on the first bar as the variable does not reset before the calculation.on the next bar it will take that old value for its new calculation. the reason you will recieve a correct value on the first bar/loop is simply because the variable has been declared as "0" which gives it an initial first bar value of "0" ( Variables: HighPriceSum(0); ) untill this value will be changed, this is emediatly after the first calculation. For BarBackNo = 0 To 9 Begin HighPriceSum = HighPriceSum + High[barBackNo]; End; correct: [b]HighPriceSum = 0;[/b] For BarBackNo = 0 To 9 Begin HighPriceSum = HighPriceSum + High[barBackNo]; End;
-
if i am certain my condition will be true at a given time i do sometimes prefere while loops, this loop will keep running untill the condition is valid, make sure that will happen otherwhise we are in a infinite loop index = 0; While ArrayToSearch[index] < Highest_A( ArrayToSearch, Array_Size ){condition} Begin index = index + 1;{instruction to repeat untill condition is true} End; IndexOfHighestArray = index;
-
Array_GetMaxIndex + Array_SetMaxIndex
flyingdutchmen replied to flyingdutchmen's topic in Coding Forum
sure, i meself couldnt emagine any script anymore without using a couple of arrays, they just seem to make life easier once you have a feeling for them. i use tradestation for the first time.in my old software they where called "vectors" amd werent as easy to use once you would like to fill a array with a certain value; hence the reason for testing tradestation now. here a pdf file, type in "array" and let it guide yo trough all the examples https://www.tradestation.com/support/books/pdf/EL_FunctionsAndReservedWords_Ref.pdf if you consider yourself a rooky, try looking on this webpage tutorial nr.7 http://www.markplex.com/tutorials.php -
Array_GetMaxIndex + Array_SetMaxIndex
flyingdutchmen replied to flyingdutchmen's topic in Coding Forum
tought i keep you updated. i have found solutions for both isues, finding out where exactly the n-highest or n-lowest value is stored wasnt to hard.i have codet an function to do the work. no need for multi-charts or any other software i now am able to change the N-highest value within an array MyArray[ IndexOfNHighestArray( MyArray, N, ArraySize ) ] = anything; i believe i even found a tricky way to decrease or increase the indices within an existing array, this one i am still working on. if there is any interest from other 2000i users i will post the scripts later on -
Array_GetMaxIndex + Array_SetMaxIndex
flyingdutchmen replied to flyingdutchmen's topic in Coding Forum
gv = Global Variables ? -
Array_GetMaxIndex + Array_SetMaxIndex
flyingdutchmen replied to flyingdutchmen's topic in Coding Forum
another platform is not an option, i am not here to discuss what software to use but rather to find out how to solve this in this old ts version. i have used another easy language compatible software which i am not using anymore for various reasons up till last month and this was a pretty easy task, i find it hard to believe it cant be done even in an older version of tradestation. if you do not see another way how i could do what i would like to do in this version of ts just let me know. -
Array_GetMaxIndex + Array_SetMaxIndex
flyingdutchmen replied to flyingdutchmen's topic in Coding Forum
how to get around it and still be able to increase or decrease the amount of indexplaces inside an existing array, is my observation correct that they did not exist yet in ts2ki version? it does have the functions NthHighest_A and others but i am trying to find the place where the second largest or N-largest number is stored inside an existing array not the number itself but the indexplace. does this TS version have any other way to find the amount of values stored in an array? lets say i have an array which has stored 50 values, then i am using NthHighestArray( MyArray, 50, 3 ) to find the 3th highest number in that array.this 3th highest number i would like to change in another number, therefore i do need to know the place where this 3th highest number is stored in order to be able to change it. -
i have recently installed the old version of TradeStation, the 2000i and i am not able to find both functions/reserved words Array_GetMaxIndex Array_SetMaxIndex they do not seem to be a reserved word or function in this version of TradeStation. i would apreciate it if anyone here could post both functions as text or let me know if there is another way to reduce the number of index places inside an array after they have been verified. i could program the Array_GetMaxIndex myself but i am not sure how to handle the other one