NexusFi: Find Your Edge


Home Menu

 





no trades registered-- Help


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
wherdendorf
harlingen texas
 
Posts: 8 since Nov 2022
Thanks Given: 4
Thanks Received: 0

A little help with this. trying a correlation trade with data2,data3 to post trades to data1. This script only has buy/sell/signals at beginning and end of day.
Objective.....data2/data3 has same bullish/bearish signals then buy/sell short next bar data1.

Inputs: cntrcts(1); Setexitonclose;
condition1= close data2>open data2;
condition2= close data3>open data3;
condition3= close data2<open data2;
condition4=close data3<open data3;
if time=0800 then begin;
if condition1 =condition2 then buy next bar at open;
if condition3=condition4 then sell short next bar at open;
end;

No trades registered between begin and exit. Yes, using 2 minute bars.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #2 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,737 since Jul 2012
Thanks Given: 1,917
Thanks Received: 7,476


wherdendorf View Post
A little help with this. trying a correlation trade with data2,data3 to post trades to data1. This script only has buy/sell/signals at beginning and end of day.
Objective.....data2/data3 has same bullish/bearish signals then buy/sell short next bar data1.

Inputs: cntrcts(1); Setexitonclose;
condition1= close data2>open data2;
condition2= close data3>open data3;
condition3= close data2<open data2;
condition4=close data3<open data3;
if time=0800 then begin;
if condition1 =condition2 then buy next bar at open;
if condition3=condition4 then sell short next bar at open;
end;

No trades registered between begin and exit. Yes, using 2 minute bars.

I would take the semicolon out after "begin" but not sure if that is the issue.

I would try debugging with print statement:

print(date," ",time," ",condition1," ",condition2, " " ,condition3," ",condition4);


and realize as written this strategy can ONLY take trades at 800. Not sure if this is what you want...


Follow me on X Reply With Quote
  #3 (permalink)
wherdendorf
harlingen texas
 
Posts: 8 since Nov 2022
Thanks Given: 4
Thanks Received: 0


Thank you for quick response. As you can tell I am new to this language. Having removes the begin statement from the
script the chart traded as it should. Problem is I want this to start to monitor conditions at 0800 and close or flatten all positions at 1500 so as to keep in day trade session. It was funny to me as the begin statement would cause order to be created at 0802. How did this happen with the begin statement especially when the script did not meet any conditions yet(long or short order). If I should not use a begin statement, then what should be used to get the desired effect of trading between 0800 and 1500?

Again thanks for looking at this novices problems.


Reply With Quote
  #4 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,737 since Jul 2012
Thanks Given: 1,917
Thanks Received: 7,476

So when you say if time=800 then buy next bar; it will buy at 8:00:001, which is the start of the 8:02 bar. bar time is noted by the end time of the bar.

You might want to use: if time>=800 and time<1500 that would be active between 800 and 1500

to make sure you exit at end of day:

if time=1500 then begin
sell next at market;
buytocover next bar at market;
end;

you might also want to change 1500 to 1458, since it the market actually closes at 1500, if you have time=1500 then order would get sent after market closed.


Follow me on X Reply With Quote
Thanked by:




Last Updated on February 5, 2023


© 2026 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 - Downloads - Top
no new posts