Topics
Replies
cyfer
24 Feb 2016, 15:14
Basically Generic Lists
Reference
Using System.Collections.Generics ;
Initiation
Private List<HistroicalTrade> LongTrades = new List<HistoricaTrade>() ;
Addition
LongTrades.ADD(a long Trade) ;
Looping
for(int i = 0 ; i< LongTrades.count ; i++) { }
its something like that mainly , you can put any type or Custom Type in a generic list
@cyfer
cyfer
16 Feb 2016, 02:10
LTSigOpen or LTSigClose is a Series of data (in this case Moving Average).. not a single value
you should be comparing the X Value in the moving average with the Y Value in price or Y Value in another moving average
so you should be going like that :
LTSigOpen.Close.Last(0) < LTSigClose.Close.Last(0) //pseudo code
this way you're comparing 2 values and it will work
@cyfer
cyfer
30 Jan 2016, 02:16
if (dms.ADX.IsRising()) { ChartObjects.DrawText("IsRising", xySpace(0, 5) + "Is the ADX Rising? " + dms.ADX.IsRising(), StaticPosition.TopLeft, Colors.Black); Print("it is Rising !"); } else { ChartObjects.RemoveObject("IsRising"); } if (dms.ADX.IsFalling()) { ChartObjects.DrawText("IsFalling", xySpace(0, 6) + "Is the ADX Falling? " + dms.ADX.IsFalling(), StaticPosition.TopLeft, Colors.Black); Print("it is Falling !"); } else { ChartObjects.RemoveObject("IsFalling"); }
I can't look into this in depth because the market is closed , but i did have problems before from this "Drawn text " multiple times with the same name
or not removing the drawn object on the chart
if this is not the solution , I suggest you keep the Print() command .. it's actually proving IsFalling & IsRising are working
@cyfer
cyfer
04 Oct 2015, 04:43
well , eh .. I got some progress .. always a delay around 3 sec !!
maybe its how long the text takes to display ?
protected override void Initialize() { Timer.Start(1); } protected override void OnTimer() { ChartObjects.DrawText("time", Time.ToString("HH:mm:ss"), StaticPosition.TopLeft); if (DateTime.Now.Minute == 37 && DateTime.Now.Second == 0) { Notifications.PlaySound("C:\\windows\\media\\tada.wav"); ChartObjects.DrawText("MESSAGETEXT_1", "Alarm triggered at: " + DateTime.Now.ToLongTimeString(), StaticPosition.Center, Colors.Yellow); } }
This lag between the exact time specified and when it shows is the problem ?
BTW , I couldn't get the sound to play .. it must be something on my PC
@cyfer
cyfer
02 Oct 2015, 23:43
it's very hard to know the problem or the fix without code , you could try to split part of the code showing the issue and post it here
however , because this is C# and you say it works some times and some times it lags .. it could be GC related
but again it's hard to tell without sample code
@cyfer
cyfer
29 Sep 2015, 07:12
That's what i did before posting the question but I always get this exception
29/09/2015 06:09:19.482 | Crashed in Initialize with SecurityException: Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
@cyfer
cyfer
29 Feb 2016, 12:52
Hello Mikro
Adding a Trade to a historical Trade List is not hard
But , in your case it is
AFAIK the Built-in Historical trade is for the Past only
so if you are trying to make the List with new Trades that didn't even Finish .. i.e after you execute the trade , it should be added to the List
then I think you should make you're own Type or Try to use Positions .
for instance , A historical trade includes the data about the Finished Date & closing Price .. which is obviously not suitable in your case
in your example , you should make your own type which includes State of the Trade (Still Open/Closed) and only if it is closed you can add it to the Historical Trade List.
I think you should be really looking into Positions , it is already a Collection
@cyfer