Jump to content

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.

marketstudent

Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by marketstudent


  1. Woops way to completely balls up :crap: I only changed a couple of lines and managed to get an additional end statement and undefined variable (block) as you guys pointed out. It's got to the stage where it needs a tidy up (as well as comments) but this should at least run

     

    
    inputs: 
    UpColor(darkgreen), 
    DownColor(red), 
    DeltaBar(1), 
    MaxBlock(9999),
    MinBlock(0),
    ResetDeltaEachBar(0); 
    
    variables: 
    MyVol(0), 
    Block(0),
    color(yellow), 
    intrabarpersist MyCurrentBar(0), 
    intrabarpersist VolumeAtBid(0), 
    intrabarpersist VolumeAtAsk(0), 
    intrabarpersist BAVolRatio(0), 
    intrabarpersist VolTmp(0), 
    intrabarpersist Delta (0), 
    intrabarpersist DeltaH (0), 
    intrabarpersist DeltaL (0), 
    intrabarpersist DeltaO (0); 
    
    if LastBarOnChart then begin 
      	MyVol = Iff(BarType < 2, Ticks, Volume); 
    if CurrentBar > MyCurrentBar then begin 
    	VolumeAtBid = 0; 
    	VolumeAtAsk = 0; 
    	BAVolRatio = 0; 
    	VolTmp = 0; 
    	MyCurrentBar = CurrentBar; 
    	if ResetDeltaEachbar = 1 then Delta =0;
    	DeltaO = Delta; 
    	DeltaH = Delta; 
    	DeltaL = Delta; 
    end; 
    Block = Myvol - VolTmp;
    if (Block >= MinBlock) and (Block <= MaxBlock) then
    	if Close <= InsideBid then
    		Delta  = Delta - MyVol + VolTmp
    	else if Close >= InsideAsk then 
    		Delta = Delta + MyVol - VolTmp ;  
    	VolTmp = MyVol ;
    end; 
    
    
    DeltaH = maxlist(DeltaH, Delta); 
    DeltaL = minlist(DeltaL, Delta); 
    
    
    if Delta <= 0 then color = DownColor else color = UpColor; 
    
    plot1(DeltaO, "DO"); 
    Plot2(DeltaH, "DH"); 
    Plot3(DeltaL, "DL"); 
    plot4(Delta, "DC");	 
    
    

     

    I am new to easylanguage, please help my questions and comments below -

     

    Questions -

    1. What's the purpose of the (if LastBarOnChart) block, is it to make sure that this indicator only works on real-time data?

     

    2. If this indicator is inserted into a 100-tick chart, how often(frequency) tradestation charting engine invokes this logic? every 1 tick?

     

    3. Is it possible to replace MyVol = Iff(BarType < 2, Ticks, Volume);

    with MyVol = Volume for 100-tick chart.

     

    Comments:

    1. BARatio, VolumeAtAsk, VolumeAtBid are not used in the code, they could be removed;

    2. cumulative volume(delta) calculation should also consider the relationship of the current bar close price with previous bar close price;

     

    Thanks!!!

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.