NexusFi: Find Your Edge


Home Menu

 





EL PriceSeriesProvider


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,441 views
    2. thumb_up 0 thanks given
    3. group 19 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread

EL PriceSeriesProvider

  #1 (permalink)
noamico
la, usa
 
Posts: 1 since Jul 2019
Thanks Given: 0
Thanks Received: 0

I'm really struggling with PSP. I got it to work at first. wanted to fetch data and everything worked smoothly. then, all of the sudden it's not loading any data even though it's stating that the state is loaded:


CODE :

method void on_Update( elsystem.Object sender, tsdata.marketdata.PriceSeriesUpdatedEventArgs args )
begin
print("updateee -- ", args.Reason.ToString());
end;


method void on_StateChanged( elsystem.Object sender, tsdata.common.StateChangedEventArgs args )
variables:
PriceSeriesProvider PPEvent;

begin
PPEvent = sender astype PriceSeriesProvider;
print("State: ", PPEvent.State.ToString());

switch PPEvent.State
begin

case DataState.loading:
break;

case DataState.unloaded:
break;

case DataState.failed:
break;

case DataState.loaded:
print("count :", PPEvent.Count);

total_volume_shares = 0;
total_volume_ticks = 0;
high_of_period = 0;
time_of_high = null;
low_of_period = 0;
time_of_low = null;
test = test + 1;

For x = PSP.Count - 1 DownTo 0 begin
//Print(PSP.Time[x].ToString(), " , ",PSP.Open[x], " , ",PSP.High[x], " , ",PSP.Low[x], " , ",PSP.Close[x]);

total_volume_shares = total_volume_shares + PSP.Volume[x];
total_volume_ticks = total_volume_ticks + PSP.Ticks[x];
If high_of_period < PSP.High[x] then begin
high_of_period = PSP.High[x];
time_of_high = PSP.Time[x];
time_of_high.AddMinutes(-1);
end;
If low_of_period > PSP.Low[x] or low_of_period = 0 then begin
low_of_period = PSP.Low[x];
time_of_low = PSP.Time[x];
time_of_low.AddMinutes(-1);
end;
end;

Print(PSP.Symbol, ", HIGH : ", high_of_period, ", HIGH_TIME : ", time_of_high.Format("%m/%d/%Y %H:%M:%S"),
", LOW : ", low_of_period, ", LOW_TIME : ", time_of_low.Format("%m/%d/%Y %H:%M:%S"), ", Volume (shares) - ", total_volume_shares, ", Volume (shares) - ", total_volume_ticks);

DataSheet.Cells[1, 3] = "erwerwerew";
DataSheet.Cells[1, 5] = 2222222;
DataSheet.Cells[3, 9] = time;
DataSheet.Cells[3, 10] = high_of_period;

//---------------------------------------------------------------------------------------------------
// With OP loaded then this could be an appropriate spot to initiate the setup of another provider,
// such as an Historical or a Realtime Orders Provider
//---------------------------------------------------------------------------------------------------
PSP = new tsdata.marketdata.PriceSeriesProvider;
//---------------------------
//psp
//---------------------------
Print(current_row, lastRow);
If current_row <= lastRow then begin
Print("ffff");
current_row = current_row + 1;

PSP.Symbol = DataSheet.Cells[2, current_row].ToString();
Value1 = ListS.PopFront(SymbolList111);
PSP.Interval.ChartType = tsdata.marketdata.DataChartType.Bars;
PSP.Interval.IntervalType = tsdata.marketdata.DataIntervalType.Minutes;
PSP.Interval.IntervalSpan = 1;
PSP.Interval.Name = "(Unknown name)";
PSP.Range.Type = tsdata.marketdata.DataRangeType.bars;
PSP.Range.FirstDate = DateTime.Parse("7/25/2019");
PSP.Range.LastDate = DateTime.Parse("7/25/2019");
PSP.Range.Name = "(Unknown name)";
PSP.IncludeVolumeInfo = true;
PSP.IncludeTicksInfo = true;
PSP.SessionName = "only Pre Market";
PSP.UseNaturalHours = false;
PSP.Realtime = true;
PSP.TimeZone = tsdata.common.TimeZone.exchange;
PSP.Name = "PSP";
PSP.Load = true;
//--------------------------------------------
// Events
//--------------------------------------------
PSP.updated += on_Update;
PSP.StateChanged += on_StateChanged;
Print("ffff444444");
end;
break;

end;
end;

Once Begin
ClearPrintLog;
Print("Log Header");
Value1 = ListS.PushBack(SymbolList111, "abil");
Value1 = ListS.PushBack(SymbolList111, "GOOG");
Value1 = ListS.PushBack(SymbolList111, "AMZN");

current_row = firstRow;
//---------------------------
//Workbook WB
//---------------------------
WB = new Workbook;
WB.FileName = ExcelFileNameWithPath;
WB.Shared = true;
WB.Visible = true;
WB.Load = true;
WB.SaveOnClose = true;
WB.Name = "Workbook1";

//---------------------------
//Sheet Sheet1
//---------------------------
DataSheet = WB.Sheets[ ExcelSheetName ];


PSP = new tsdata.marketdata.PriceSeriesProvider;
//---------------------------
//psp
//---------------------------
PSP.Symbol = DataSheet.Cells[2, current_row].ToString();
PSP.Interval.ChartType = tsdata.marketdata.DataChartType.Bars;
PSP.Interval.IntervalType = tsdata.marketdata.DataIntervalType.Minutes;
PSP.Interval.IntervalSpan = 1;
PSP.Interval.Name = "(Unknown name)";
PSP.Range.Type = tsdata.marketdata.DataRangeType.bars;
PSP.Range.FirstDate = DateTime.Parse("7/18/2019");
PSP.Range.LastDate = DateTime.Parse("7/18/2019");
PSP.Range.Name = "(Unknown name)";
PSP.IncludeVolumeInfo = true;
PSP.IncludeTicksInfo = true;
PSP.SessionName = "only Pre Market";
PSP.UseNaturalHours = false;
PSP.Realtime = true;
PSP.TimeZone = tsdata.common.TimeZone.exchange;
PSP.Name = "PSP";
PSP.Load = true;
//--------------------------------------------
// Events
//--------------------------------------------
PSP.updated += on_Update;
PSP.StateChanged += on_StateChanged;

End;










is there anyway for you to help ?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Deepmoney LLM
Elite Quantitative GenAI/LLM
Exit Strategy
NinjaTrader
ZombieSqueeze
Platforms and Indicators
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks




Last Updated on August 12, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts