NexusFi: Find Your Edge


Home Menu

 





StrToBool question


Discussion in EasyLanguage Programming

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




 
Search this Thread

StrToBool question

  #1 (permalink)
benracz
Miami, USA
 
Posts: 11 since May 2017
Thanks Given: 1
Thanks Received: 9

Hi Everyone,

I'm in the process of developing a web-based monitoring system for my trading and MultiCharts/EL strategies, and I find myself thinking: under certain circumstances it could it be cool to be able to specify some rules from a web interface, and execute them with MultiCharts/in EL, using only a web GUI.

The problem I'm stuck with - and this is probably impossible to solve, but I thought I'd post here and ask anyway -, is how do I turn a "string" input (saved to a file, or taken from database using sharedvar server, or any other solution) into a proper boolean that would then in turn convert the condition from a string to a 1 to a 0 depending on whether it's true or not. So I could just go on the web, take a "Rule" text window and put "rsi(close,50) > 20" or something, hit save, that would go to a file or database, find its way into a variable in MultiCharts and the strategy would get backtested/executed on MultiCharts without having to recompile code (to which I have found no good "remote" solution yet).

I find myself craving for either a command-line compiler or an StrToBool function or something and wondering if anyone has any other solution to this.

The closest I've gotten with my brainstorm was to run another app to backtest in, and save the backtest results (1 or 0 for every bar) into a file and then using that variable - since it's a number already. But the workaround is messy.

Does anyone happen to have any solution to this that I'm not thinking of?

-Ben

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Futures True Range Report
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
62 thanks
Funded Trader platforms
42 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
Battlestations: Show us your trading desks!
24 thanks
The Program
17 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623


Ben,

you could write your own StrToBool function, pass a string to it, evaluate it and return a Boolean.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
benracz
Miami, USA
 
Posts: 11 since May 2017
Thanks Given: 1
Thanks Received: 9

Hi ABC,

Thank you for the response.

Maybe it's just me being slow, but how would you "evaluate" whether the "string" containing a trading rule (for example "close > rsi(close, 21)") is "true" or "false"? It's just a string, as far as the compiler is concerned!

This is where I'm stuck at. It might be just too simple for me to see it, been working long hours lately haha

-Ben

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

Ben,

this will only work if you know what you are looking for i.e. the function would have to be aware of the possible strings in advance and evaluate what ever you pass based on that.
You might be able to break down the string in multiple parts and have the function combine it, though.

Regards,

ABCTG


benracz View Post
Hi ABC,

Thank you for the response.

Maybe it's just me being slow, but how would you "evaluate" whether the "string" containing a trading rule (for example "close > rsi(close, 21)") is "true" or "false"? It's just a string, as far as the compiler is concerned!

This is where I'm stuck at. It might be just too simple for me to see it, been working long hours lately haha

-Ben


Follow me on Twitter Reply With Quote
  #6 (permalink)
benracz
Miami, USA
 
Posts: 11 since May 2017
Thanks Given: 1
Thanks Received: 9

Yeah - that was kind of the point. I could as well generate a database of signals with 1's and 0's in advance and bool from there. But it kind of negates the whole point of doing it. Which is why I was looking for an actual, proper solution/ideas. Thanks for the brainstorm though.

Reply With Quote




Last Updated on July 5, 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