HOME FORUMS BROKERS SOFTWARE BOOKS CONTACT US
Elite Trader Your Account  •  Become a Member  •  Help  •  Search    
    Forums ›› Technically Speaking ›› Strategy (System) Design ›› first program help  


Post A Reply
    
dematto
 

Registered: Sep 2012
Posts: 6

 

09-06-12 09:25 PM

I made a program in OmegaT
I started on this platform to start using easylenguage (I I program in other languages)

I am writing some code that gives me error
in practice assign a variable when I send a trade.

then check that variable and if the volatility increases close the position


the problem is not in the efficiency of the program
but in the print which should not be done

...
VARS: giallaup (0), gialladw (0), bluup (0), bludw (0), lr (0), bbw (0), pt (0), bbwv(0);
...

bbw= delta_BollingerWidth(price, lenbb, 1);
lr = linearregvaluefc (price, lenlr, 0);

if lr> bluup then
begin;
sell;
pt = -1;
bbwv= bbw;
end;


if pt = -1 then begin;
if MarketPosition = -1 and bbw> bbwv then begin;
exitshort;
print (bbw, " ", bbwv);
end;

if MarketPosition = 1 and bbw> bbwv then begin;
exitlong;
print (bbw, " ", bbwv);
end;

end;



enters the positions, but give me the print
10.00 10.00
10.00 10.00
10.00 10.00

I do not understand why, if the two values ​​must be different ---> bbw> bbwv
why gives me the print!????

    Edit/Delete Quote Complain
intradaybill
 

Registered: Feb 2008
Posts: 2962

 

09-07-12 01:27 PM

Two things assuming this is Tradesation 2000i code:

1 - There is no function "sell" I believe". I remember there was a "Sell Next Bar" or somehting along these lines.
2- You have no code to go long but you are exiting longs;

    Edit/Delete Quote Complain
dematto
 

Registered: Sep 2012
Posts: 6

 

09-07-12 06:42 PM


Quote from intradaybill:

Two things assuming this is Tradesation 2000i code:

1 - There is no function "sell" I believe". I remember there was a "Sell Next Bar" or somehting along these lines.
2- You have no code to go long but you are exiting longs;



thanks for the reply

1) I do not think this is because for
the program does the operations

2) could be but I do not understand why the print from me two identical values ​​for the two variables that had to be different

to give me the same two variables I should write
bbw= bbwv;
(after the exit)


if MarketPosition = 1 and bbw> bbwv then begin;
exitlong;
print (bbw, " ", bbwv);
end;

    Edit/Delete Quote Complain
intradaybill
 

Registered: Feb 2008
Posts: 2962

 

09-08-12 03:48 PM

hmm.... one value could be 10.0001 and the other 10.00001

Try comparing the absolute value of the difference to a small value like:

abs(a - b) < 0.00000001

Comparing diectly real values when they can have small diffrences in a bad practice.

    Edit/Delete Quote Complain
dematto
 

Registered: Sep 2012
Posts: 6

 

09-12-12 05:41 PM

thanks for the advice I'll try and I'll tell you how it goes

    Edit/Delete Quote Complain
    
Post A Reply


Receive an email whenever a new post is added to this thread by subscribing to it.
 
Rate This Thread:

Forum Jump:
 

 

   Conduct Rules  -  Privacy Policy  -  Day Trader -  Day Trader Forum -  Best Trading Software -  Sitemap Copyright © 2013, Elite Trader. All rights reserved.    
 
WHILE YOU'RE HERE, TAKE A MINUTE TO VISIT SOME OF OUR SPONSORS:
Advantage Futures
Futures Brokerage & Clearing
AMP Global Clearing
Futures and FX Trading
Bright Trading
Professional Equities Trading
CTS
Futures Trading Software
DaytradingBias.com
Professional Trading Analytics
ECHOtrade
Professional Trading Firm
eSignal
Trading Software Provider
FXCM
Forex Trading Services
Global Futures
Futures, Options & FX Trading
Interactive Brokers
Pro Gateway to World Markets
JC Trading Group
Direct Access Trading
MB Trading
Direct Access Trading
MultiCharts
Trading Software Provider
NinjaTrader
Trading Software Provider
OANDA
Currency Trading
optionshouse
Option Trading & Education
Rithmic
Futures Trade Execution Platform
SpeedTrader
Direct Access Trading
SpreadProfessor
Spread Trading Instruction
thinkorswim by TD Ameritrade
Direct Access TradingAdvertisement
TradersStudio
System Building & Backtesting
Trading Technologies
Trading Software Provider
Trend Following
Trading Systems Provider