CKWParticipant
Veteran
Hi,
I have an issue with “ArraySort($MAArray, ASCEND)” in Pro order.
The same with Unset, the way I code is not correct? Please advise.
e.g.
$MAArray[1] = DMAS20
$MAArray[2] = DMAS50
$MAArray[3] = DMAS200
ArraySort($MAArray, ASCEND)
br
CKW
Rewrite those few lines trying not to type unsupported characters.
If the error is still reported, then it’s an error in one of the lines prior to 248.
@CKW, if that is in ProOrder indeed (hence Strategy Code and not an Indicator) … both ArraySort and Unset are not supported there. You can see that by the syntax highlighting. So do you ?
https://www.prorealcode.com/topic/array-variables-availability-in-prorealtime/page/12/#post-185587
CKWParticipant
Veteran
Hi PeterSt, Robertogozzi,
Thanks.
@CKW, if that is in ProOrder indeed (hence Strategy Code and not an Indicator) … both ArraySort and Unset are not supported there. You can see that by the syntax highlighting. So do you ?
https://www.prorealcode.com/topic/array-variables-availability-in-prorealtime/page/12/#post-185587
Thanks for telling that Pro order not support both ArraySort and unset :). There is no warning /error description saying that this syntax are not supporting.
br
CKW
There is no warning /error description saying that this syntax are not supporting.
Hmm …
Paste this over the standard code in a new strategy :
// Condities om long posities te openen
Uwcondities = 1
IF NOT LongOnMarket AND UwCondities THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
// Condities om long posities te sluiten
If LongOnMarket AND UwCondities THEN
SELL AT MARKET
ENDIF
// Condities om short posities te openen
IF NOT ShortOnMarket AND UwCondities THEN
SELLSHORT 1 CONTRACTS AT MARKET
ENDIF
// Condities om short posities te sluiten
IF ShortOnMarket AND UwCondities THEN
EXITSHORT AT MARKET
ENDIF
// Stops en targets : Voer uw beschermende stops en winst targets hier in
$MAArray[1] = DMAS20
$MAArray[2] = DMAS50
$MAArray[3] = DMAS200
ArraySort($MAArray, ASCEND)
You should see that warning sign at the bottom line. If not, I wonder what could be going on.
But watch out. The below code (see attached) shows the lines pasted from your post. And now the syntax error does *not* show, BUT it appears on line 1 you see there (I copied the line numbers from the code you showed).
This makes Roberto’s remark correct in the first place because now indeed the message appears as with you. Btw hint : this is most probably about an If/Endif mismatch.
But the ArraySort and Unset are still not supported … 🙁
PS:
$MAArray[1] = DMAS20
Not that you asked for it, but notice that the first element of an array is [0] (not [1]).
Not that you asked for it, but notice that the first element of an array is [0] (not [1]).
I actually almost always start from element 1 (I count elements myself, I only occasionally use LASTSET).
I prefer using element 0 to store say, the date I created it, or last modified it, or any other info I may need, sometimes assembling numbers to combine conditions, such as:
– first digit (1=only for LONG trades, 2=only for SHORT trades, 9=all trades allowed, not 0 because it would be dropped, being the first digit)
– second to seventh digit for the last time I modified/added any element
– and more, provided it does not exceed the supported length (which I don’t know, maybe 12+ digits)
– then 5 digits for the number of elements
so it may contain 9 09300 00212 (which is for ALL trades, LAST modified at 9:30am, containing 212 elements, combined is 909300000212).
ArraySort and Unset instructions are about to be possible with IG accounts this week.